diff options
author | Brian Somers <brian@FreeBSD.org> | 1998-04-17 22:04:36 +0000 |
---|---|---|
committer | Brian Somers <brian@FreeBSD.org> | 1998-04-17 22:04:36 +0000 |
commit | 030e4ebba8c44830e3230d5fe56ef0a2c52e037b (patch) | |
tree | 3f73f8a0db414f42e2ab2ef1418c745b1dbfaa3e /usr.sbin/ppp/datalink.c | |
parent | 50e5c17d3b629da141c4db23ca23327f38d1a66f (diff) | |
download | src-030e4ebba8c44830e3230d5fe56ef0a2c52e037b.tar.gz src-030e4ebba8c44830e3230d5fe56ef0a2c52e037b.zip |
o Remove bundle_LinkLost() and have the modem routines simply
call datalink_Down() where appropriate rather than
modem_Hangup().
o Now, when something horrible happens (failed read/write, loss
of carrier etc), we go offline and run any hangup scripts etc
in a controlled manner - exactly the same as if someone says
``down'' at the prompt or sends us a HUP.
o -dedicated links that fail to make the modem raw close it,
suffer the redial timeout then try to open it again.
o Add a ``carrier lost'' warning diagnostic.
Notes
Notes:
svn path=/cvs2svn/branches/MP/; revision=35254
Diffstat (limited to 'usr.sbin/ppp/datalink.c')
-rw-r--r-- | usr.sbin/ppp/datalink.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/usr.sbin/ppp/datalink.c b/usr.sbin/ppp/datalink.c index 482568563251..aac9672cc461 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.1.2.37 1998/04/14 23:17:04 brian Exp $ + * $Id: datalink.c,v 1.1.2.38 1998/04/16 00:25:56 brian Exp $ */ #include <sys/types.h> @@ -67,6 +67,7 @@ #include "datalink.h" static const char *datalink_State(struct datalink *); +static void datalink_LoginDone(struct datalink *); static void datalink_OpenTimeout(void *v) @@ -102,6 +103,13 @@ datalink_StartDialTimer(struct datalink *dl, int Timeout) static void datalink_HangupDone(struct datalink *dl) { + if (dl->physical->type == PHYS_DEDICATED && !dl->bundle->CleaningUp && + Physical_GetFD(dl->physical) != -1) { + /* Don't close our modem if the link is dedicated */ + datalink_LoginDone(dl); + return; + } + modem_Close(dl->physical); dl->phone.chosen = "N/A"; @@ -167,8 +175,12 @@ datalink_LoginDone(struct datalink *dl) dl->state = DATALINK_HANGUP; modem_Offline(dl->physical); chat_Init(&dl->chat, dl->physical, dl->cfg.script.hangup, 1, NULL); - } else + } else { + if (dl->physical->type == PHYS_DEDICATED) + /* force a redial timeout */ + modem_Close(dl->physical); datalink_HangupDone(dl); + } } else { dl->dial_tries = -1; |