diff options
-rw-r--r-- | usr.sbin/ppp/bundle.c | 2 | ||||
-rw-r--r-- | usr.sbin/ppp/command.c | 2 | ||||
-rw-r--r-- | usr.sbin/ppp/datalink.c | 35 |
3 files changed, 21 insertions, 18 deletions
diff --git a/usr.sbin/ppp/bundle.c b/usr.sbin/ppp/bundle.c index 5e808de..34f7a02 100644 --- a/usr.sbin/ppp/bundle.c +++ b/usr.sbin/ppp/bundle.c @@ -376,7 +376,7 @@ bundle_Close(struct bundle *bundle, const char *name, int how) switch (how) { case CLOSE_LCP: datalink_DontHangup(dl); - /* fall through */ + break; case CLOSE_STAYDOWN: datalink_StayDown(dl); break; diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c index dd9da83..fb36f19 100644 --- a/usr.sbin/ppp/command.c +++ b/usr.sbin/ppp/command.c @@ -151,7 +151,7 @@ #define NEG_MPPE 54 #define NEG_CHAP81 55 -const char Version[] = "2.3"; +const char Version[] = "2.3.1"; static int ShowCommand(struct cmdargs const *); static int TerminalCommand(struct cmdargs const *); diff --git a/usr.sbin/ppp/datalink.c b/usr.sbin/ppp/datalink.c index 84b9af7..e3e248e 100644 --- a/usr.sbin/ppp/datalink.c +++ b/usr.sbin/ppp/datalink.c @@ -510,15 +510,17 @@ datalink_Write(struct fdescriptor *d, struct bundle *bundle, static void datalink_ComeDown(struct datalink *dl, int how) { - if (how != CLOSE_NORMAL) { - dl->dial.tries = -1; - dl->reconnect_tries = 0; - if (dl->state >= DATALINK_READY && how == CLOSE_LCP) - dl->stayonline = 1; - } + int stayonline; - if (dl->state >= DATALINK_READY && dl->stayonline) { - dl->stayonline = 0; + if (how == CLOSE_LCP) + datalink_DontHangup(dl); + else if (how == CLOSE_STAYDOWN) + datalink_StayDown(dl); + + stayonline = dl->stayonline; + dl->stayonline = 0; + + if (dl->state >= DATALINK_READY && stayonline) { physical_StopDeviceTimer(dl->physical); datalink_NewState(dl, DATALINK_READY); } else if (dl->state != DATALINK_CLOSED && dl->state != DATALINK_HANGUP) { @@ -993,13 +995,11 @@ datalink_Close(struct datalink *dl, int how) case DATALINK_AUTH: case DATALINK_LCP: datalink_AuthReInit(dl); + if (how == CLOSE_LCP) + datalink_DontHangup(dl); + else if (how == CLOSE_STAYDOWN) + datalink_StayDown(dl); fsm_Close(&dl->physical->link.lcp.fsm); - if (how != CLOSE_NORMAL) { - dl->dial.tries = -1; - dl->reconnect_tries = 0; - if (how == CLOSE_LCP) - dl->stayonline = 1; - } break; default: @@ -1033,14 +1033,17 @@ datalink_Down(struct datalink *dl, int how) void datalink_StayDown(struct datalink *dl) { + dl->dial.tries = -1; dl->reconnect_tries = 0; + dl->stayonline = 0; } void datalink_DontHangup(struct datalink *dl) { - if (dl->state >= DATALINK_LCP) - dl->stayonline = 1; + dl->dial.tries = -1; + dl->reconnect_tries = 0; + dl->stayonline = dl->state >= DATALINK_LCP ? 1 : 0; } int |