]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lwip.git/commitdiff
Fixed bug #32648 (PPP code crashes when terminating a link) by only calling sio_read_...
authorgoldsimon <goldsimon>
Tue, 22 Mar 2011 20:59:49 +0000 (20:59 +0000)
committergoldsimon <goldsimon>
Tue, 22 Mar 2011 20:59:49 +0000 (20:59 +0000)
CHANGELOG
src/netif/ppp/ppp.c

index 75c1495d2c6e9c508d1cb452deb7370d38eab1e9..17e1a7501492e020e8f2b0d187234294bc7ad161 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -233,6 +233,10 @@ HISTORY
 
   ++ Bugfixes:
 
+  2011-03-22: Simon Goldschmidt
+  * ppp.c: Fixed bug #32648 (PPP code crashes when terminating a link) by only
+    calling sio_read_abort() if the file descriptor is valid.
+
   2011-03-14: Simon Goldschmidt
   * err.h/.c, sockets.c, api_msg.c: fixed bug #31748 (Calling non-blocking connect
     more than once can render a socket useless) since it mainly involves changing
index 0c2d20e8e870f8a293c2e8ef27e96885f2c36ff2..c302b424ad618b5fb7c9667797c050c5af1bf217 100644 (file)
@@ -344,7 +344,9 @@ static void
 pppRecvWakeup(int pd)
 {
   PPPDEBUG(LOG_DEBUG, ("pppRecvWakeup: unit %d\n", pd));
-  sio_read_abort(pppControl[pd].fd);
+  if (pppControl[pd].openFlag != 0) {
+    sio_read_abort(pppControl[pd].fd);
+  }
 }
 #endif /* PPPOS_SUPPORT */
 
@@ -681,20 +683,8 @@ pppClose(int pd)
 void
 pppSigHUP(int pd)
 {
-#if PPPOE_SUPPORT
-  PPPControl *pc = &pppControl[pd];
-  if(pc->ethif) {
-    PPPDEBUG(LOG_DEBUG, ("pppSigHUP: unit %d sig_hup -> pppHupCB\n", pd));
-    pppHup(pd);
-  } else
-#endif /* PPPOE_SUPPORT */
-  {
-#if PPPOS_SUPPORT
-    PPPDEBUG(LOG_DEBUG, ("pppSigHUP: unit %d sig_hup -> pppHupCB\n", pd));
-    pppHup(pd);
-    pppRecvWakeup(pd);
-#endif /* PPPOS_SUPPORT */
-  }
+  PPPDEBUG(LOG_DEBUG, ("pppSigHUP: unit %d sig_hup -> pppHupCB\n", pd));
+  pppHup(pd);
 }
 
 #if PPPOS_SUPPORT