diff options
author | brian <brian@FreeBSD.org> | 2001-05-22 19:42:14 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2001-05-22 19:42:14 +0000 |
commit | bd7ad7312ad8b29e652c66ba3ec750fd9208bd37 (patch) | |
tree | 451edc31f2fb8e7493b8e4a8c30d132be4aaa22e /usr.sbin/ppp | |
parent | 53829812525551d44793280058aed8219133cb7a (diff) | |
download | FreeBSD-src-bd7ad7312ad8b29e652c66ba3ec750fd9208bd37.zip FreeBSD-src-bd7ad7312ad8b29e652c66ba3ec750fd9208bd37.tar.gz |
Don't say ``Enter pause (-1) for redialing when we're using a random interval.
Show the calculated random value instead.
Suggested by: Bill Richter <richterb@binkley.foothill.net>
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r-- | usr.sbin/ppp/datalink.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/usr.sbin/ppp/datalink.c b/usr.sbin/ppp/datalink.c index e3e248e..5f8544f 100644 --- a/usr.sbin/ppp/datalink.c +++ b/usr.sbin/ppp/datalink.c @@ -93,19 +93,16 @@ datalink_StartDialTimer(struct datalink *dl, int Timeout) timer_Stop(&dl->dial.timer); if (Timeout) { - if (Timeout > 0) - dl->dial.timer.load = Timeout * SECTICKS; - else { + if (Timeout < 0) result = (random() % DIAL_TIMEOUT) + 1; - dl->dial.timer.load = result * SECTICKS; - } + 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, Timeout); + dl->name, result); } return result; } |