summaryrefslogtreecommitdiff
path: root/usr.sbin/ppp
diff options
context:
space:
mode:
authorbrian <brian@cvs.openbsd.org>2001-01-26 01:40:44 +0000
committerbrian <brian@cvs.openbsd.org>2001-01-26 01:40:44 +0000
commitfa528850b0d852e2b1c0514d51bb5421731e3e02 (patch)
treec8ef5b191a805f7ba04451ff49da002e1e944255 /usr.sbin/ppp
parent3de6619b7370c8b8b418f02557d94be634ffa765 (diff)
If executing the stuff from ppp.linkdown results in a state change,
don't continue adjusting the ipcp state machine. This allows ``down'' to work in ppp.linkdown - useful for a tunnel setup.
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r--usr.sbin/ppp/ppp/fsm.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.sbin/ppp/ppp/fsm.c b/usr.sbin/ppp/ppp/fsm.c
index fc258a65d32..1055367e27f 100644
--- a/usr.sbin/ppp/ppp/fsm.c
+++ b/usr.sbin/ppp/ppp/fsm.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $OpenBSD: fsm.c,v 1.15 2000/07/19 11:06:33 brian Exp $
+ * $OpenBSD: fsm.c,v 1.16 2001/01/26 01:40:43 brian Exp $
*
* TODO:
*/
@@ -349,10 +349,12 @@ fsm_Close(struct fsm *fp)
break;
case ST_OPENED:
(*fp->fn->LayerDown)(fp);
- FsmInitRestartCounter(fp, FSM_TRM_TIMER);
- FsmSendTerminateReq(fp);
- NewState(fp, ST_CLOSING);
- (*fp->parent->LayerDown)(fp->parent->object, fp);
+ if (fp->state == ST_OPENED) {
+ FsmInitRestartCounter(fp, FSM_TRM_TIMER);
+ FsmSendTerminateReq(fp);
+ NewState(fp, ST_CLOSING);
+ (*fp->parent->LayerDown)(fp->parent->object, fp);
+ }
break;
case ST_REQSENT:
case ST_ACKRCVD: