diff options
author | brian <brian@FreeBSD.org> | 1997-06-17 01:46:05 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1997-06-17 01:46:05 +0000 |
commit | 75122c3d710f7621b6f1b8eb863c99206d89af09 (patch) | |
tree | f32b034a32fe09f5103151b73f21073b0cc4d461 /usr.sbin/ppp/main.c | |
parent | 4c6c70e5ae5328a7b16d98017e13ac4f556faaf3 (diff) | |
download | FreeBSD-src-75122c3d710f7621b6f1b8eb863c99206d89af09.zip FreeBSD-src-75122c3d710f7621b6f1b8eb863c99206d89af09.tar.gz |
Handle redial tries correctly under -ddial
Diffstat (limited to 'usr.sbin/ppp/main.c')
-rw-r--r-- | usr.sbin/ppp/main.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/usr.sbin/ppp/main.c b/usr.sbin/ppp/main.c index f8a9345..c24e501 100644 --- a/usr.sbin/ppp/main.c +++ b/usr.sbin/ppp/main.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: main.c,v 1.62 1997/06/16 13:24:59 brian Exp $ + * $Id: main.c,v 1.63 1997/06/16 19:59:41 brian Exp $ * * TODO: * o Add commands for traffic summary, version display, etc. @@ -812,13 +812,13 @@ DoLoop() modem = OpenModem(mode); if (modem < 0) { tries++; - if (VarDialTries) + if (!(mode & MODE_DDIAL) && VarDialTries) LogPrintf(LogCHAT, "Failed to open modem (attempt %u of %d)\n", - tries, VarDialTries); + tries, VarDialTries); else - LogPrintf(LogCHAT, "Failed to open modem (attempt %u)\n", tries); + LogPrintf(LogCHAT, "Failed to open modem (attempt %u)\n", tries); - if (VarDialTries && tries >= VarDialTries) { + if (!(mode & MODE_DDIAL) && VarDialTries && tries >= VarDialTries) { if (mode & MODE_BACKGROUND) Cleanup(EX_DIAL); /* Can't get the modem */ dial_up = FALSE; @@ -829,11 +829,11 @@ DoLoop() StartRedialTimer(VarRedialTimeout); } else { tries++; /* Tries are per number, not per list of numbers. */ - if (VarDialTries) - LogPrintf(LogCHAT, "Dial attempt %u of %d\n", tries, - VarDialTries); + if (!(mode & MODE_DDIAL) && VarDialTries) + LogPrintf(LogCHAT, "Dial attempt %u of %d\n", tries, VarDialTries); else - LogPrintf(LogCHAT, "Dial attempt %u\n", tries); + LogPrintf(LogCHAT, "Dial attempt %u\n", tries); + if (DialModem() == EX_DONE) { sleep(1); /* little pause to allow peer starts */ ModemTimeout(); @@ -849,7 +849,8 @@ DoLoop() else /* Try all numbers in background mode */ StartRedialTimer(VarRedialNextTimeout); - } else if (VarDialTries && tries >= VarDialTries) { + } else if (!(mode & MODE_DDIAL) && VarDialTries + && tries >= VarDialTries) { /* I give up ! Can't get through :( */ StartRedialTimer(VarRedialTimeout); dial_up = FALSE; |