diff options
author | brian <brian@FreeBSD.org> | 1998-06-20 00:19:42 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1998-06-20 00:19:42 +0000 |
commit | 6e7ded224d09f6b63debbee1e5db7b1ae4a0a100 (patch) | |
tree | 61871da340727d4a950d33f20362d1b0d2d93c3f /usr.sbin/ppp/fsm.c | |
parent | d3ff12efce40503105e4580a0d3213a8793a5e89 (diff) | |
download | FreeBSD-src-6e7ded224d09f6b63debbee1e5db7b1ae4a0a100.zip FreeBSD-src-6e7ded224d09f6b63debbee1e5db7b1ae4a0a100.tar.gz |
Create & use fsm2initial(), a function to bring a
state machine back to ST_INITIAL without going
through any unnecessary TLS/TLF pairs.
Diffstat (limited to 'usr.sbin/ppp/fsm.c')
-rw-r--r-- | usr.sbin/ppp/fsm.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/usr.sbin/ppp/fsm.c b/usr.sbin/ppp/fsm.c index a25caf1..498077b 100644 --- a/usr.sbin/ppp/fsm.c +++ b/usr.sbin/ppp/fsm.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: fsm.c,v 1.29 1998/06/15 19:06:42 brian Exp $ + * $Id: fsm.c,v 1.30 1998/06/16 19:40:36 brian Exp $ * * TODO: */ @@ -119,11 +119,8 @@ StoppedTimeout(void *v) fp->link->name, fp->name); timer_Stop(&fp->OpenTimer); } - if (fp->state == ST_STOPPED) { - /* Force ourselves back to initial */ - fsm_Down(fp); - fsm_Close(fp); - } + if (fp->state == ST_STOPPED) + fsm2initial(fp); } void @@ -959,3 +956,14 @@ fsm_NullRecvResetAck(struct fsm *fp, u_char id) log_Printf(fp->LogLevel, "%s: Oops - received unexpected reset ack\n", fp->link->name); } + +void +fsm2initial(struct fsm *fp) +{ + if (fp->state == ST_STOPPED) + fsm_Close(fp); + if (fp->state > ST_INITIAL) + fsm_Down(fp); + if (fp->state > ST_INITIAL) + fsm_Close(fp); +} |