diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1997-10-25 05:09:59 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1997-10-25 05:09:59 +0000 |
commit | 5e481cffa62ea10828c38f0327d1f9a7b01b6114 (patch) | |
tree | 2a36d69eaf0c3d84853f5234ee7184c81c49fefd /usr.sbin | |
parent | 07c4031de656f6efb84460d36a7cd22ff9fe959f (diff) |
Set CLOCAL for chat script by default. Add new option "modem_chat"
to override the default for people using cua devices who want chat
to detect loss of carrier.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pppd/main.c | 12 | ||||
-rw-r--r-- | usr.sbin/pppd/options.c | 16 | ||||
-rw-r--r-- | usr.sbin/pppd/pppd.8 | 7 | ||||
-rw-r--r-- | usr.sbin/pppd/pppd.h | 3 |
4 files changed, 28 insertions, 10 deletions
diff --git a/usr.sbin/pppd/main.c b/usr.sbin/pppd/main.c index e1dc38c16a1..717991a60c6 100644 --- a/usr.sbin/pppd/main.c +++ b/usr.sbin/pppd/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.18 1997/09/05 04:32:42 millert Exp $ */ +/* $OpenBSD: main.c,v 1.19 1997/10/25 05:09:56 millert Exp $ */ /* * main.c - Point-to-Point Protocol main module @@ -20,7 +20,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: main.c,v 1.18 1997/09/05 04:32:42 millert Exp $"; +static char rcsid[] = "$OpenBSD: main.c,v 1.19 1997/10/25 05:09:56 millert Exp $"; #endif #include <stdio.h> @@ -452,11 +452,11 @@ main(argc, argv) /* * Set line speed, flow control, etc. - * Previously, if we had a connection script, we would set CLOCAL - * while the script was running. But then, if CD was negated - * before the script finished, we would miss it. + * Note that unless modem_chat is set the chat script has + * no way of noticing if carrier drops. This is a necessary + * evil for systems without cua devices. */ - set_up_tty(ttyfd, 0); + set_up_tty(ttyfd, (modem_chat == 0)); /* run connection script */ if (connector && connector[0]) { diff --git a/usr.sbin/pppd/options.c b/usr.sbin/pppd/options.c index 878c3b9c52b..2ee306d84d1 100644 --- a/usr.sbin/pppd/options.c +++ b/usr.sbin/pppd/options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options.c,v 1.9 1997/09/05 04:32:43 millert Exp $ */ +/* $OpenBSD: options.c,v 1.10 1997/10/25 05:09:57 millert Exp $ */ /* * options.c - handles option processing for PPP. @@ -23,7 +23,7 @@ #if 0 static char rcsid[] = "Id: options.c,v 1.39 1997/07/14 03:53:34 paulus Exp"; #else -static char rcsid[] = "$OpenBSD: options.c,v 1.9 1997/09/05 04:32:43 millert Exp $"; +static char rcsid[] = "$OpenBSD: options.c,v 1.10 1997/10/25 05:09:57 millert Exp $"; #endif #endif @@ -89,6 +89,7 @@ int default_device = 1; /* Using /dev/tty or equivalent */ char devnam[MAXPATHLEN] = "/dev/tty"; /* Device name */ int crtscts = 0; /* Use hardware flow control */ int modem = 1; /* Use modem control lines */ +int modem_chat = 0; /* Use modem control lines during chat */ int inspeed = 0; /* Input/Output speed requested */ u_int32_t netmask = 0; /* IP netmask to set on interface */ int lockflag = 0; /* Create lock file to lock the serial dev */ @@ -180,6 +181,7 @@ static int setnocrtscts __P((char **)); static int setxonxoff __P((char **)); static int setnodetach __P((char **)); static int setmodem __P((char **)); +static int setmodem_chat __P((char **)); static int setlocal __P((char **)); static int setlock __P((char **)); static int setname __P((char **)); @@ -327,6 +329,7 @@ static struct cmd { {"passive", 0, setpassive}, /* Set passive mode */ {"silent", 0, setsilent}, /* Set silent mode */ {"modem", 0, setmodem}, /* Use modem control lines */ + {"modem_chat", 0, setmodem_chat}, /* Use modem control lines during chat */ {"local", 0, setlocal}, /* Don't use modem control lines */ {"lock", 0, setlock}, /* Lock serial device (with lock file) */ {"name", 1, setname}, /* Set local name for authentication */ @@ -440,6 +443,7 @@ Usage: %s [ options ], where options are:\n\ defaultroute Add default route through interface\n\ file <f> Take options from file <f>\n\ modem Use modem control lines\n\ + modem_chat Use modem control lines during chat\n\ mru <n> Set MRU value to <n> for negotiation\n\ netmask <n> Set interface netmask to <n>\n\ See pppd(8) for more options.\n\ @@ -1870,6 +1874,14 @@ setmodem(argv) } static int +setmodem_chat(argv) + char **argv; +{ + modem_chat = 1; + return 1; +} + +static int setlocal(argv) char **argv; { diff --git a/usr.sbin/pppd/pppd.8 b/usr.sbin/pppd/pppd.8 index 7fdb77980ee..ee60f5900a0 100644 --- a/usr.sbin/pppd/pppd.8 +++ b/usr.sbin/pppd/pppd.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pppd.8,v 1.9 1997/09/02 20:08:37 angelos Exp $ +.\" $OpenBSD: pppd.8,v 1.10 1997/10/25 05:09:58 millert Exp $ .\" manual page [] for pppd 2.3 .\" SH section heading .\" SS subsection heading @@ -405,6 +405,11 @@ Terminal Ready) signal briefly when the connection is terminated and before executing the connect script. On Ultrix, this option implies hardware flow control, as for the \fBcrtscts\fR option. +.B modem_chat +Use the modem control lines during the chat script. The default is +to ignore the state of the CD (Carrier Detect) signal from the modem +during the chat script. If you are using a cua device (as opposed to +a tty device) you should set this option. .TP .B ms-dns \fI<addr> If diff --git a/usr.sbin/pppd/pppd.h b/usr.sbin/pppd/pppd.h index 5c831402576..5dd30475793 100644 --- a/usr.sbin/pppd/pppd.h +++ b/usr.sbin/pppd/pppd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pppd.h,v 1.6 1997/09/05 04:32:45 millert Exp $ */ +/* $OpenBSD: pppd.h,v 1.7 1997/10/25 05:09:56 millert Exp $ */ /* * pppd.h - PPP daemon global declarations. @@ -81,6 +81,7 @@ extern int default_device; /* Using /dev/tty or equivalent */ extern char devnam[]; /* Device name */ extern int crtscts; /* Use hardware flow control */ extern int modem; /* Use modem control lines */ +extern int modem_chat; /* Watch carrier detect in chat script */ extern int inspeed; /* Input/Output speed requested */ extern u_int32_t netmask; /* IP netmask to set on interface */ extern int lockflag; /* Create lock file to lock the serial dev */ |