summaryrefslogtreecommitdiff
path: root/usr.sbin/ppp
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>1999-10-08 08:17:18 +0000
committerBrian Somers <brian@FreeBSD.org>1999-10-08 08:17:18 +0000
commit6648ab21f5325c00a2e98ccfa2c2f8ea04b14715 (patch)
treec86066de1c5baf1ccc266571e2aea70857e8acbc /usr.sbin/ppp
parent0f0874a4ea56aa7ab507f2844b24c622dffe34bc (diff)
Notes
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r--usr.sbin/ppp/datalink.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/usr.sbin/ppp/datalink.c b/usr.sbin/ppp/datalink.c
index 693f69bc755e..9c27b5666b16 100644
--- a/usr.sbin/ppp/datalink.c
+++ b/usr.sbin/ppp/datalink.c
@@ -277,7 +277,7 @@ datalink_UpdateSet(struct descriptor *d, fd_set *r, fd_set *w, fd_set *e,
dl->name, dl->cfg.dial.max - dl->dial.tries,
dl->cfg.dial.max);
} else
- datalink_LoginDone(dl);
+ datalink_NewState(dl, DATALINK_CARRIER);
return datalink_UpdateSet(d, r, w, e, n);
} else {
if (!(dl->physical->type & (PHYS_DDIAL|PHYS_DEDICATED)) &&
@@ -316,14 +316,20 @@ datalink_UpdateSet(struct descriptor *d, fd_set *r, fd_set *w, fd_set *e,
return 0; /* A device timer is running to wake us up again */
case CARRIER_OK:
- datalink_NewState(dl, DATALINK_LOGIN);
- chat_Init(&dl->chat, dl->physical, dl->cfg.script.login, 0, NULL);
+ if (dl->script.run) {
+ datalink_NewState(dl, DATALINK_LOGIN);
+ chat_Init(&dl->chat, dl->physical, dl->cfg.script.login, 0, NULL);
+ } else
+ datalink_LoginDone(dl);
return datalink_UpdateSet(d, r, w, e, n);
case CARRIER_LOST:
- datalink_NewState(dl, DATALINK_HANGUP);
physical_Offline(dl->physical); /* Is this required ? */
- chat_Init(&dl->chat, dl->physical, dl->cfg.script.hangup, 1, NULL);
+ if (dl->script.run) {
+ datalink_NewState(dl, DATALINK_HANGUP);
+ chat_Init(&dl->chat, dl->physical, dl->cfg.script.hangup, 1, NULL);
+ } else
+ datalink_HangupDone(dl);
return datalink_UpdateSet(d, r, w, e, n);
}