summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/main.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-05-24 17:32:42 +0000
committerbrian <brian@FreeBSD.org>1997-05-24 17:32:42 +0000
commit81067cb46e8543e07d85f87008d4ccacf1eabee6 (patch)
treeb216757aa8c78fa7bae8a9c15316cbeffdcce71f /usr.sbin/ppp/main.c
parent16ff4223276d7d07622d8962c3924ef714ccff73 (diff)
downloadFreeBSD-src-81067cb46e8543e07d85f87008d4ccacf1eabee6.zip
FreeBSD-src-81067cb46e8543e07d85f87008d4ccacf1eabee6.tar.gz
Fix the reconnect option, and add an explanation to vars.h
Diffstat (limited to 'usr.sbin/ppp/main.c')
-rw-r--r--usr.sbin/ppp/main.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.sbin/ppp/main.c b/usr.sbin/ppp/main.c
index 0193d92..1ff814d 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.54 1997/05/23 04:54:03 brian Exp $
+ * $Id: main.c,v 1.55 1997/05/23 05:22:48 brian Exp $
*
* TODO:
* o Add commands for traffic summary, version display, etc.
@@ -223,8 +223,8 @@ int signo;
}
else {
LogPrintf(LOG_PHASE_BIT, "Signal %d, terminate.\n", signo);
+ reconnect(RECON_FALSE);
LcpClose();
- reconnectCount = 0;
Cleanup(EX_TERM);
}
}
@@ -756,7 +756,7 @@ DoLoop()
timeout.tv_sec = 0;
timeout.tv_usec = 0;
- reconnectRequired = 0;
+ reconnectState = RECON_UNKNOWN;
if (mode & MODE_BACKGROUND)
dial_up = TRUE; /* Bring the line up */
@@ -780,7 +780,7 @@ DoLoop()
* back up.
*/
if (LcpFsm.state <= ST_CLOSED) {
- if (dial_up != TRUE && reconnectRequired) {
+ if (dial_up != TRUE && reconnectState == RECON_TRUE) {
if (++reconnectCount <= VarReconnectTries) {
LogPrintf(LOG_PHASE_BIT, "Connection lost, re-establish (%d/%d)\n",
reconnectCount, VarReconnectTries);
@@ -794,8 +794,8 @@ DoLoop()
if (mode & MODE_BACKGROUND)
Cleanup(EX_DEAD);
}
+ reconnectState = RECON_ENVOKED;
}
- reconnectRequired = 0;
}
/*
@@ -821,6 +821,7 @@ DoLoop()
ModemTimeout();
PacketMode();
dial_up = FALSE;
+ reconnectState = RECON_UNKNOWN;
tries = 0;
} else {
CloseModem();
@@ -834,6 +835,8 @@ DoLoop()
/* I give up ! Can't get through :( */
StartRedialTimer(VarRedialTimeout);
dial_up = FALSE;
+ reconnectState = RECON_UNKNOWN;
+ reconnectCount = 0;
tries = 0;
} else if (VarNextPhone == NULL)
/* Dial failed. Keep quite during redial wait period. */
OpenPOWER on IntegriCloud