mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-15 10:17:20 +00:00
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
This commit is contained in:
parent
983c1b5875
commit
dad51e5ce8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=85362
@ -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 *);
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user