]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/ipcp.c
small changes suggested by Seth Chaiklin
[ppp.git] / pppd / ipcp.c
index 6aeb3abae5dcb2ce06530225c0912fe62ce4f788..41eabd2192ed0363394a5bc6e611ec80d43dff2f 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: ipcp.c,v 1.39 1999/03/16 03:12:03 paulus Exp $";
+static char rcsid[] = "$Id: ipcp.c,v 1.43 1999/03/19 04:23:39 paulus Exp $";
 #endif
 
 /*
@@ -52,6 +52,7 @@ static int cis_received[NUM_PPP];     /* # Conf-Reqs received */
 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() */
 
 /*
  * Callbacks for fsm code.  (CI = Configuration Information)
@@ -182,6 +183,7 @@ struct protent ipcp_protent = {
     NULL,
     1,
     "IPCP",
+    "IP",
     ipcp_option_list,
     ip_check_options,
     ip_demand_conf,
@@ -846,12 +848,9 @@ ipcp_nakci(f, p, len)
        p = next;
     }
 
-    /* If there is still anything left, this packet is bad. */
-    if (len != 0)
-       goto bad;
-
     /*
      * OK, the Nak is good.  Now we can update state.
+     * If there are any remaining options, we ignore them.
      */
     if (f->state != OPENED)
        *go = try;
@@ -1497,6 +1496,7 @@ ipcp_up(f)
     }
 
     np_up(f->unit, PPP_IP);
+    ipcp_is_up = 1;
 
     /*
      * Execute the ip-up script, like this:
@@ -1520,7 +1520,12 @@ ipcp_down(f)
     fsm *f;
 {
     IPCPDEBUG(("ipcp: down"));
-    np_down(f->unit, PPP_IP);
+    if (get_ppp_stats(f->unit, &link_stats))
+       link_stats_valid = 1;
+    if (ipcp_is_up) {
+       ipcp_is_up = 0;
+       np_down(f->unit, PPP_IP);
+    }
     sifvjcomp(f->unit, 0, 0, 0);
 
     /*