diff options
author | brian <brian@FreeBSD.org> | 1999-10-07 07:32:12 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1999-10-07 07:32:12 +0000 |
commit | b78d8db34777845803e7b5ec75eceea8a804fafd (patch) | |
tree | 71de40949bd74eb2ed15ce89c07a1c2bad17db0c /usr.sbin | |
parent | 9ac9ad09b0b875b5e8e0739078ed1b98f3a94bdb (diff) | |
download | FreeBSD-src-b78d8db34777845803e7b5ec75eceea8a804fafd.zip FreeBSD-src-b78d8db34777845803e7b5ec75eceea8a804fafd.tar.gz |
Don't go from datalink state opening directly to lcp, go via
carrier instead so that we can set up our carrier detect
timer and eventually notice when we lose carrier.
Honour the script.run value when coming out of carrier state.
PR: 14145
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ppp/datalink.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/usr.sbin/ppp/datalink.c b/usr.sbin/ppp/datalink.c index 3113a13..4dc104e 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); } |