]> git.ozlabs.org Git - ppp.git/commitdiff
Fix a couple of state transitions
authorPaul Mackerras <paulus@samba.org>
Sun, 29 Jun 2003 10:06:14 +0000 (10:06 +0000)
committerPaul Mackerras <paulus@samba.org>
Sun, 29 Jun 2003 10:06:14 +0000 (10:06 +0000)
Make sure we only call np_finished once

pppd/fsm.c
pppd/ipcp.c

index 6385fa7c3418cda10299d004de4feadcdb6d6194..4a5c2a80c31166f8dc3fb84d3743083186bfebc4 100644 (file)
@@ -40,7 +40,7 @@
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-#define RCSID  "$Id: fsm.c,v 1.19 2002/12/04 23:03:32 paulus Exp $"
+#define RCSID  "$Id: fsm.c,v 1.20 2003/06/29 10:06:14 paulus Exp $"
 
 /*
  * TODO:
@@ -406,6 +406,7 @@ fsm_rconfreq(f, id, inp, len)
        if( f->callbacks->down )
            (*f->callbacks->down)(f);   /* Inform upper layers */
        fsm_sconfreq(f, 0);             /* Send initial Configure-Request */
+       f->state = REQSENT;
        break;
 
     case STOPPED:
@@ -626,6 +627,7 @@ fsm_rtermack(f)
        if (f->callbacks->down)
            (*f->callbacks->down)(f);   /* Inform upper layers */
        fsm_sconfreq(f, 0);
+       f->state = REQSENT;
        break;
     }
 }
index c3b052160f949ad74b679bec3c9cac3b15b97fa8..1ed4c07796706e3a9e9ce63817e75f2b9600fdb2 100644 (file)
@@ -40,7 +40,7 @@
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-#define RCSID  "$Id: ipcp.c,v 1.62 2002/12/04 23:03:32 paulus Exp $"
+#define RCSID  "$Id: ipcp.c,v 1.63 2003/06/29 10:06:14 paulus Exp $"
 
 /*
  * TODO:
@@ -91,6 +91,7 @@ static int default_route_set[NUM_PPP];        /* Have set up a default route */
 static int proxy_arp_set[NUM_PPP];     /* Have created proxy arp entry */
 static bool usepeerdns;                        /* Ask peer for DNS addrs */
 static int ipcp_is_up;                 /* have called np_up() */
+static int ipcp_is_open;               /* haven't called np_finished() */
 static bool ask_for_local;             /* request our address from peer */
 static char vj_value[8];               /* string form of vj option value */
 static char netmask_str[20];           /* string form of netmask value */
@@ -602,6 +603,7 @@ ipcp_open(unit)
     int unit;
 {
     fsm_open(&ipcp_fsm[unit]);
+    ipcp_is_open = 1;
 }
 
 
@@ -1894,7 +1896,10 @@ static void
 ipcp_finished(f)
     fsm *f;
 {
-    np_finished(f->unit, PPP_IP);
+       if (ipcp_is_open) {
+               ipcp_is_open = 0;
+               np_finished(f->unit, PPP_IP);
+       }
 }