]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/lcp.c
fix problem where lcp echo requests were getting doubled,
[ppp.git] / pppd / lcp.c
index 1ee727fa0fe2f4b51d60793e9a9d079f8c9e7d49..f8e52fe0964b4182fe9f5c1c60026032c3fc0989 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: lcp.c,v 1.37 1999/03/19 01:24:56 paulus Exp $";
+static char rcsid[] = "$Id: lcp.c,v 1.41 1999/06/24 00:16:38 paulus Exp $";
 #endif
 
 /*
@@ -1056,6 +1056,7 @@ lcp_nakci(f, p, len)
            if (++try.numloops >= lcp_loopbackfail) {
                notice("Serial line is looped back.");
                lcp_close(f->unit, "Loopback detected");
+               status = EXIT_LOOPBACK;
            }
        } else
            try.numloops = 0;
@@ -1724,7 +1725,7 @@ lcp_printpkt(p, plen, printer, arg)
                if (olen >= CILEN_CHAR) {
                    p += 2;
                    printer(arg, "callback ");
-                   GETSHORT(cishort, p);
+                   GETCHAR(cishort, p);
                    switch (cishort) {
                    case CBCP_OPT:
                        printer(arg, "CBCP");
@@ -1805,6 +1806,7 @@ void LcpLinkFailure (f)
        info("No response to %d echo-requests", lcp_echos_pending);
         notice("Serial link appears to be disconnected.");
         lcp_close(f->unit, "Peer not responding");
+       status = EXIT_PEER_DEAD;
     }
 }
 
@@ -1817,6 +1819,8 @@ LcpEchoCheck (f)
     fsm *f;
 {
     LcpSendEchoRequest (f);
+    if (f->state != OPENED)
+       return;
 
     /*
      * Start the timer for the next interval.