X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Flcp.c;h=7f643b2ca7d21230b51437f7eda08cead334f43b;hp=1ee727fa0fe2f4b51d60793e9a9d079f8c9e7d49;hb=07de73a331240b97d915c1851431a743449dd0f4;hpb=1fd9b499c32e19ecbd2be685f7af98e7e4252808 diff --git a/pppd/lcp.c b/pppd/lcp.c index 1ee727f..7f643b2 100644 --- a/pppd/lcp.c +++ b/pppd/lcp.c @@ -17,9 +17,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#ifndef lint -static char rcsid[] = "$Id: lcp.c,v 1.37 1999/03/19 01:24:56 paulus Exp $"; -#endif +#define RCSID "$Id: lcp.c,v 1.45 1999/09/11 12:08:56 paulus Exp $"; /* * TODO: @@ -35,6 +33,8 @@ static char rcsid[] = "$Id: lcp.c,v 1.37 1999/03/19 01:24:56 paulus Exp $"; #include "chap.h" #include "magic.h" +static const char rcsid[] = RCSID; + /* * LCP-related command-line options. */ @@ -64,7 +64,7 @@ static option_t lcp_option_list[] = { { "-as", o_uint32, &lcp_wantoptions[0].asyncmap, "Set asyncmap (for received packets)", OPT_OR, &lcp_wantoptions[0].neg_asyncmap }, - { "nomagicnumber", o_bool, &lcp_wantoptions[0].neg_magicnumber, + { "nomagic", o_bool, &lcp_wantoptions[0].neg_magicnumber, "Disable magic number negotiation (looped-back line detection)", OPT_A2COPY, &lcp_allowoptions[0].neg_magicnumber }, { "-mn", o_bool, &lcp_wantoptions[0].neg_magicnumber, @@ -336,7 +336,7 @@ lcp_close(unit, reason) fsm *f = &lcp_fsm[unit]; if (phase != PHASE_DEAD) - phase = PHASE_TERMINATE; + new_phase(PHASE_TERMINATE); if (f->state == STOPPED && f->flags & (OPT_PASSIVE|OPT_SILENT)) { /* * This action is not strictly according to the FSM in RFC1548, @@ -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.