summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2001-10-23 13:52:19 +0000
committerbrian <brian@FreeBSD.org>2001-10-23 13:52:19 +0000
commit5106c4a5345e5d56ae3c2511585b4c54be1baf2d (patch)
treec9c6b3b2a9af4036f6cef860cb2a83406d4fb3d4 /usr.sbin
parentf907f56cde6be702a62e8bba04eecaa35b3f573c (diff)
downloadFreeBSD-src-5106c4a5345e5d56ae3c2511585b4c54be1baf2d.zip
FreeBSD-src-5106c4a5345e5d56ae3c2511585b4c54be1baf2d.tar.gz
Don't avoid setting a 0 second timer in datalink_StartDialTimer() by
not setting any timer. Instead, set a 1 millisecond timer. This ensures that ppp will come out of it's select() call after losing carrier in -ddial mode with a reconnect period of 0 and going to ST_OPENING, rather than waiting indefinitely for some other event to wake ppp up. Bump the ppp version number to indicate the event. MFC after: 3 days
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ppp/command.c2
-rw-r--r--usr.sbin/ppp/datalink.c22
2 files changed, 11 insertions, 13 deletions
diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c
index ae68eec..3da1db2 100644
--- a/usr.sbin/ppp/command.c
+++ b/usr.sbin/ppp/command.c
@@ -164,7 +164,7 @@
#define NEG_MPPE 54
#define NEG_CHAP81 55
-const char Version[] = "3.0.0";
+const char Version[] = "3.0.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 3781023..1bbf3cc 100644
--- a/usr.sbin/ppp/datalink.c
+++ b/usr.sbin/ppp/datalink.c
@@ -97,18 +97,16 @@ datalink_StartDialTimer(struct datalink *dl, int Timeout)
int result = Timeout;
timer_Stop(&dl->dial.timer);
- if (Timeout) {
- if (Timeout < 0)
- result = (random() % DIAL_TIMEOUT) + 1;
- dl->dial.timer.load = result * SECTICKS;
- dl->dial.timer.func = datalink_OpenTimeout;
- dl->dial.timer.name = "dial";
- dl->dial.timer.arg = dl;
- timer_Start(&dl->dial.timer);
- if (dl->state == DATALINK_OPENING)
- log_Printf(LogPHASE, "%s: Enter pause (%d) for redialing.\n",
- dl->name, result);
- }
+ if (Timeout < 0)
+ result = (random() % DIAL_TIMEOUT) + 1;
+ dl->dial.timer.load = result ? result * SECTICKS : 1;
+ dl->dial.timer.func = datalink_OpenTimeout;
+ dl->dial.timer.name = "dial";
+ dl->dial.timer.arg = dl;
+ timer_Start(&dl->dial.timer);
+ if (dl->state == DATALINK_OPENING)
+ log_Printf(LogPHASE, "%s: Enter pause (%d) for redialing.\n",
+ dl->name, result);
return result;
}
OpenPOWER on IntegriCloud