summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/datalink.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1998-07-03 17:24:38 +0000
committerbrian <brian@FreeBSD.org>1998-07-03 17:24:38 +0000
commite15057ae7cfa8d8f9f129ea1ec98514ab36f269d (patch)
treef742a04526d50cb7837da4c074d36fe3c520dc0a /usr.sbin/ppp/datalink.c
parent4a55b250d402fbee412172e44607f4469a953273 (diff)
downloadFreeBSD-src-e15057ae7cfa8d8f9f129ea1ec98514ab36f269d.zip
FreeBSD-src-e15057ae7cfa8d8f9f129ea1ec98514ab36f269d.tar.gz
Only start checking carrier when the datalink state machine
exceeds DATALINK_READY. When we go back to READY or less (eg. ``close lcp''), switch the carrier-checking-timer off again. This fixes the callback example in ppp.conf.sample. Noted as broken by: Damian Kuczynski <damian@best.pw.edu.pl>
Diffstat (limited to 'usr.sbin/ppp/datalink.c')
-rw-r--r--usr.sbin/ppp/datalink.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/ppp/datalink.c b/usr.sbin/ppp/datalink.c
index fc2a841..5ab9794 100644
--- a/usr.sbin/ppp/datalink.c
+++ b/usr.sbin/ppp/datalink.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: datalink.c,v 1.14 1998/06/27 14:18:04 brian Exp $
+ * $Id: datalink.c,v 1.15 1998/06/30 23:04:14 brian Exp $
*/
#include <sys/types.h>
@@ -174,6 +174,7 @@ datalink_LoginDone(struct datalink *dl)
modem_Offline(dl->physical);
chat_Init(&dl->chat, dl->physical, dl->cfg.script.hangup, 1, NULL);
} else {
+ timer_Stop(&dl->physical->Timer);
if (dl->physical->type == PHYS_DEDICATED)
/* force a redial timeout */
modem_Close(dl->physical);
@@ -289,7 +290,7 @@ datalink_UpdateSet(struct descriptor *d, fd_set *r, fd_set *w, fd_set *e,
case DATALINK_DIAL:
case DATALINK_LOGIN:
datalink_NewState(dl, DATALINK_HANGUP);
- modem_Offline(dl->physical);
+ modem_Offline(dl->physical); /* Is this required ? */
chat_Init(&dl->chat, dl->physical, dl->cfg.script.hangup, 1, NULL);
return datalink_UpdateSet(d, r, w, e, n);
}
@@ -402,6 +403,7 @@ datalink_ComeDown(struct datalink *dl, int how)
if (dl->state >= DATALINK_READY && dl->stayonline) {
dl->stayonline = 0;
+ timer_Stop(&dl->physical->Timer);
datalink_NewState(dl, DATALINK_READY);
} else if (dl->state != DATALINK_CLOSED && dl->state != DATALINK_HANGUP) {
modem_Offline(dl->physical);
OpenPOWER on IntegriCloud