X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Ffsm.c;h=043f7f0709192818138d082e536694400e971b5a;hb=6e6bb3246106e680463c106d1ee6b773fc4f9c5a;hp=387f7012928f0d2d7d9bab6a0c1ab3fccb34d143;hpb=428d4139c39999841f8ecc76a8b3414fd93edd3f;p=ppp.git diff --git a/pppd/fsm.c b/pppd/fsm.c index 387f701..043f7f0 100644 --- a/pppd/fsm.c +++ b/pppd/fsm.c @@ -40,7 +40,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define RCSID "$Id: fsm.c,v 1.21 2004/02/02 02:52:51 carlsonj Exp $" +#define RCSID "$Id: fsm.c,v 1.22 2004/02/02 03:57:19 carlsonj Exp $" /* * TODO: @@ -208,8 +208,9 @@ fsm_open(f) * send a terminate-request message as configured. */ static void -terminate_layer(f) +terminate_layer(f, nextstate) fsm *f; + int nextstate; { if( f->state != OPENED ) UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ @@ -227,7 +228,7 @@ terminate_layer(f) * We've already fired off one Terminate-Request just to be nice * to the peer, but we're not going to wait for a reply. */ - f->state = CLOSED; + f->state = nextstate == CLOSING ? CLOSED : STOPPED; if( f->callbacks->finished ) (*f->callbacks->finished)(f); return; @@ -236,7 +237,7 @@ terminate_layer(f) TIMEOUT(fsm_timeout, f, f->timeouttime); --f->retransmits; - f->state = CLOSING; + f->state = nextstate; } /* @@ -267,7 +268,7 @@ fsm_close(f, reason) case ACKRCVD: case ACKSENT: case OPENED: - terminate_layer(f); + terminate_layer(f, CLOSING); break; } } @@ -714,7 +715,7 @@ fsm_protreject(f) break; case OPENED: - terminate_layer(f); + terminate_layer(f, STOPPING); break; default: