summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2005-07-18 22:51:04 +0000
committerBrad Smith <brad@cvs.openbsd.org>2005-07-18 22:51:04 +0000
commit25912fafa9126985433ffb79aea454362a3fc550 (patch)
tree5e4418e940f631b4b3d7b5c473ccdaa864579816
parent9b9e7ff0b1576cd64885e1e76336bdc127791ccc (diff)
Add a ``force-scripts'' option for using chat scripts with -direct and
-dedicated links. From brian FreeBSD
-rw-r--r--usr.sbin/ppp/ppp/bundle.h31
-rw-r--r--usr.sbin/ppp/ppp/command.c9
-rw-r--r--usr.sbin/ppp/ppp/datalink.c5
-rw-r--r--usr.sbin/ppp/ppp/ppp.8.m423
4 files changed, 44 insertions, 24 deletions
diff --git a/usr.sbin/ppp/ppp/bundle.h b/usr.sbin/ppp/ppp/bundle.h
index 430deffc42f..1523285c74d 100644
--- a/usr.sbin/ppp/ppp/bundle.h
+++ b/usr.sbin/ppp/ppp/bundle.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $OpenBSD: bundle.h,v 1.24 2002/05/16 01:13:39 brian Exp $
+ * $OpenBSD: bundle.h,v 1.25 2005/07/18 22:51:03 brad Exp $
*/
#define PHASE_DEAD 0 /* Link is dead */
@@ -33,22 +33,23 @@
#define PHASE_TERMINATE 4 /* Terminating link */
/* cfg.opt bit settings */
-#define OPT_FILTERDECAP 0x0001
-#define OPT_IDCHECK 0x0002
-#define OPT_IFACEALIAS 0x0004
+#define OPT_FILTERDECAP 0x0001
+#define OPT_FORCE_SCRIPTS 0x0002 /* force chat scripts */
+#define OPT_IDCHECK 0x0004
+#define OPT_IFACEALIAS 0x0008
#ifndef NOINET6
-#define OPT_IPCP 0x0008
-#define OPT_IPV6CP 0x0010
+#define OPT_IPCP 0x0010
+#define OPT_IPV6CP 0x0020
#endif
-#define OPT_KEEPSESSION 0x0020
-#define OPT_LOOPBACK 0x0040
-#define OPT_PASSWDAUTH 0x0080
-#define OPT_PROXY 0x0100
-#define OPT_PROXYALL 0x0200
-#define OPT_SROUTES 0x0400
-#define OPT_TCPMSSFIXUP 0x0800
-#define OPT_THROUGHPUT 0x1000
-#define OPT_UTMP 0x2000
+#define OPT_KEEPSESSION 0x0040
+#define OPT_LOOPBACK 0x0080
+#define OPT_PASSWDAUTH 0x0100
+#define OPT_PROXY 0x0200
+#define OPT_PROXYALL 0x0400
+#define OPT_SROUTES 0x0800
+#define OPT_TCPMSSFIXUP 0x1000
+#define OPT_THROUGHPUT 0x2000
+#define OPT_UTMP 0x4000
#define MAX_ENDDISC_CLASS 5
diff --git a/usr.sbin/ppp/ppp/command.c b/usr.sbin/ppp/ppp/command.c
index d93d287be91..7339faab7a9 100644
--- a/usr.sbin/ppp/ppp/command.c
+++ b/usr.sbin/ppp/ppp/command.c
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $OpenBSD: command.c,v 1.86 2005/07/17 19:13:24 brad Exp $
+ * $OpenBSD: command.c,v 1.87 2005/07/18 22:51:03 brad Exp $
*/
#include <sys/param.h>
@@ -2862,6 +2862,9 @@ static struct cmdtab const NegotiateCommands[] = {
{"filter-decapsulation", NULL, OptSet, LOCAL_AUTH,
"filter on PPPoUDP payloads", "disable|enable",
(const void *)OPT_FILTERDECAP},
+ {"force-scripts", NULL, OptSet, LOCAL_AUTH,
+ "Force execution of the configured chat scripts", "disable|enable",
+ (const void *)OPT_FORCE_SCRIPTS},
{"idcheck", NULL, OptSet, LOCAL_AUTH, "Check FSM reply ids",
"disable|enable", (const void *)OPT_IDCHECK},
{"iface-alias", NULL, IfaceAliasOptSet, LOCAL_AUTH,
@@ -2893,9 +2896,9 @@ static struct cmdtab const NegotiateCommands[] = {
"disable|enable", (const void *)OPT_UTMP},
#ifndef NOINET6
-#define OPT_MAX 14 /* accept/deny allowed below and not above */
+#define OPT_MAX 15 /* accept/deny allowed below and not above */
#else
-#define OPT_MAX 12
+#define OPT_MAX 13
#endif
{"acfcomp", NULL, NegotiateSet, LOCAL_AUTH | LOCAL_CX,
diff --git a/usr.sbin/ppp/ppp/datalink.c b/usr.sbin/ppp/ppp/datalink.c
index dcac70fb90a..80273d21078 100644
--- a/usr.sbin/ppp/ppp/datalink.c
+++ b/usr.sbin/ppp/ppp/datalink.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $OpenBSD: datalink.c,v 1.46 2005/07/17 20:24:45 brad Exp $
+ * $OpenBSD: datalink.c,v 1.47 2005/07/18 22:51:03 brad Exp $
*/
#include <sys/param.h>
@@ -962,7 +962,8 @@ datalink_Destroy(struct datalink *dl)
void
datalink_Up(struct datalink *dl, int runscripts, int packetmode)
{
- if (dl->physical->type & (PHYS_DIRECT|PHYS_DEDICATED))
+ if (!Enabled(dl->bundle, OPT_FORCE_SCRIPTS) &&
+ (dl->physical->type & (PHYS_DIRECT|PHYS_DEDICATED)))
/* Ignore scripts */
runscripts = 0;
diff --git a/usr.sbin/ppp/ppp/ppp.8.m4 b/usr.sbin/ppp/ppp/ppp.8.m4
index 73b043c6172..f4aa06d14c4 100644
--- a/usr.sbin/ppp/ppp/ppp.8.m4
+++ b/usr.sbin/ppp/ppp/ppp.8.m4
@@ -25,7 +25,7 @@ changecom(,)dnl
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: ppp.8.m4,v 1.24 2005/07/17 07:33:22 brad Exp $
+.\" $OpenBSD: ppp.8.m4,v 1.25 2005/07/18 22:51:03 brad Exp $
.\"
.Dd September 20, 1995
.Dt PPP 8
@@ -149,11 +149,17 @@ This is useful if you wish to control
.Nm ppp Ns 's
invocation from another process.
.It Fl direct
-This is used for receiving incoming connections.
+This is used for communicating over an already established connection,
+usually when receiving incoming connections accepted by
+.Xr getty 8 .
.Nm
ignores the
.Ic set device
line and uses descriptor 0 as the link.
+.Nm
+will also ignore any configured chat scripts unless the
+.Dq force-scripts
+option has been enabled.
.Pp
If callback is configured,
.Nm
@@ -164,8 +170,10 @@ information when dialing back.
This option is designed for machines connected with a dedicated
wire.
.Nm
-will always keep the device open and will never use any configured
-chat scripts.
+will always keep the device open and will ignore any configured
+chat scripts unless the
+.Dq force-scripts
+option has been enabled.
.It Fl ddial
This mode is equivalent to
.Fl auto
@@ -2974,6 +2982,13 @@ and
in the configuration for the
.Nm
invocation with the udp link.
+.It force-scripts
+Default: Disabled.
+Forces execution of the configured chat scripts in
+.Dv direct
+and
+.Dv dedicated
+modes.
.It idcheck
Default: Enabled.
When