From: Paul Mackerras Date: Mon, 9 May 1994 04:32:41 +0000 (+0000) Subject: fix to make it terminate when signalled in passive/silent modes. X-Git-Tag: ppp-2-1-2a~52 X-Git-Url: https://git.ozlabs.org/?p=ppp.git;a=commitdiff_plain;h=afe0aeff34d3e453578f1c419946453600633654;hp=fc1c5cdfc62dbfc81f42f77f72e21f72ad53edcb fix to make it terminate when signalled in passive/silent modes. --- 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]); }