summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2001-02-04 01:08:22 +0000
committerbrian <brian@FreeBSD.org>2001-02-04 01:08:22 +0000
commit75b98b19e66ca2d1d64e6228ea1f70ddede7e6a8 (patch)
treec6b1721da500439670285d550baee813142512f9 /usr.sbin
parent2b4420e8f9beb187125c4fcc9a5844c4a510c3ef (diff)
downloadFreeBSD-src-75b98b19e66ca2d1d64e6228ea1f70ddede7e6a8.zip
FreeBSD-src-75b98b19e66ca2d1d64e6228ea1f70ddede7e6a8.tar.gz
Untangle some cunfusion between the CLOSE_STAYDOWN, CLOSE_LCP and
CLOSE_NORMAL meanings. CLOSE_NORMAL doesn't change the currently required state, the others do. This should stop ppp from entering DATALINK_READY when LCP shutdown doesn't end up happening cleanly. Bump our version number to reflect this change.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ppp/bundle.c2
-rw-r--r--usr.sbin/ppp/command.c2
-rw-r--r--usr.sbin/ppp/datalink.c35
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
OpenPOWER on IntegriCloud