summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/lcp.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-10-05 15:00:10 +0000
committerbrian <brian@FreeBSD.org>1997-10-05 15:00:10 +0000
commite5021654d070c56d1267b15191452b632c62b1b9 (patch)
tree5482a97f4b20f325103ec829e5f9dd418034d0c8 /usr.sbin/ppp/lcp.c
parent1f236d536d1afe42f75c61fa1479cbb6c89ab246 (diff)
downloadFreeBSD-src-e5021654d070c56d1267b15191452b632c62b1b9.zip
FreeBSD-src-e5021654d070c56d1267b15191452b632c62b1b9.tar.gz
Change things around a bit when bringing down the layers.
o LcpLayerDown() no longer does a NewPhase(PHASE_TERMINATE). Instead, it's done in LcpLayerFinish(). LayerFinish() gets called by the FSM after the LCP FSM goes through the Stopping and Stopped states. o -direct and -background mode exit at PHASE_TERMINATE, not PHASE_DEAD. The result is that LCP, CCP & IPCP are brought down cleanly on both sides of the link (not just our side). Killing ppp rather than just closing it still makes it get out after the LCP SendTerminateReq(). I'll have a look at that soon. We're probably not actually sending the REQ :-(
Diffstat (limited to 'usr.sbin/ppp/lcp.c')
-rw-r--r--usr.sbin/ppp/lcp.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/usr.sbin/ppp/lcp.c b/usr.sbin/ppp/lcp.c
index d72679d..85e9e73 100644
--- a/usr.sbin/ppp/lcp.c
+++ b/usr.sbin/ppp/lcp.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: lcp.c,v 1.36 1997/09/27 19:41:40 brian Exp $
+ * $Id: lcp.c,v 1.37 1997/09/29 19:40:16 brian Exp $
*
* TODO:
* o Validate magic number received from peer.
@@ -127,7 +127,7 @@ NewPhase(int new)
CcpUp();
CcpOpen();
break;
- case PHASE_DEAD:
+ case PHASE_TERMINATE:
if (mode & MODE_DIRECT)
Cleanup(EX_DEAD);
if (mode & MODE_BACKGROUND && reconnectState != RECON_TRUE)
@@ -350,6 +350,8 @@ LcpLayerFinish(struct fsm * fp)
NewPhase(PHASE_DEAD);
StopAllTimers();
(void) OsInterfaceDown(0);
+ /* We're down at last. Lets tell background and direct mode to get out */
+ NewPhase(PHASE_TERMINATE);
Prompt();
}
@@ -376,7 +378,10 @@ LcpLayerDown(struct fsm * fp)
StopAllTimers();
OsLinkdown();
LogPrintf(LogLCP, "LcpLayerDown\n");
- NewPhase(PHASE_TERMINATE);
+ /*
+ * OsLinkdown() brings CCP & IPCP down, then waits 'till we go from
+ * STOPPING to STOPPED. At this point, the FSM gives us a LayerFinish
+ */
}
void
@@ -393,6 +398,10 @@ LcpDown()
NewPhase(PHASE_DEAD);
StopAllTimers();
FsmDown(&LcpFsm);
+ /*
+ * We now wait for the FsmDown() to result in a LcpLayerDown() (if we're
+ * open).
+ */
}
void
OpenPOWER on IntegriCloud