X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Flcp.c;h=e1eb6f2a4bfbe1896fbc3edaaf999ec551e46041;hp=5b47a84f8114ba1e587908f1bf589e764835c47f;hb=afe0aeff34d3e453578f1c419946453600633654;hpb=63817f712ad80eaa38bc7e549926f7e032a42f42 diff --git a/pppd/lcp.c b/pppd/lcp.c index 5b47a84..e1eb6f2 100644 --- a/pppd/lcp.c +++ b/pppd/lcp.c @@ -18,7 +18,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: lcp.c,v 1.3 1994/04/18 04:00:25 paulus Exp $"; +static char rcsid[] = "$Id: lcp.c,v 1.4 1994/05/09 04:32:41 paulus Exp $"; #endif /* @@ -183,7 +183,20 @@ void lcp_close(unit) int unit; { - fsm_close(&lcp_fsm[unit]); + fsm *f = &lcp_fsm[unit]; + + if (f->state == STOPPED && f->flags & (OPT_PASSIVE|OPT_SILENT)) { + /* + * This action is not strictly according to the FSM in RFC1548, + * but it does mean that the program terminates if you do a + * lcp_close(0) in passive/silent mode when a connection hasn't + * been established. + */ + f->state = CLOSED; + lcp_finished(f); + + } else + fsm_close(&lcp_fsm[unit]); }