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 :-(
This commit is contained in:
Brian Somers 1997-10-05 15:00:10 +00:00
parent d37641d82c
commit e70c96ab58

View File

@ -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