summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2003-03-26 02:03:08 +0000
committerbrian <brian@FreeBSD.org>2003-03-26 02:03:08 +0000
commita3b7ff0585aaa0f9babe6826da6304e1b19f827e (patch)
tree103bf8a3cfb13fa6467e92ee8d78b3ec18afd2d4 /usr.sbin
parente182583687dded87435725b546353654d6d0b9cd (diff)
downloadFreeBSD-src-a3b7ff0585aaa0f9babe6826da6304e1b19f827e.zip
FreeBSD-src-a3b7ff0585aaa0f9babe6826da6304e1b19f827e.tar.gz
Add a ``force-scripts'' option for using chat scripts with -direct and
-dedicated links. Submitted by: Maksim Yevmenkin <myevmenk@exodus.net>
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ppp/bundle.h29
-rw-r--r--usr.sbin/ppp/command.c7
-rw-r--r--usr.sbin/ppp/datalink.c3
-rw-r--r--usr.sbin/ppp/ppp.8.m421
4 files changed, 40 insertions, 20 deletions
diff --git a/usr.sbin/ppp/bundle.h b/usr.sbin/ppp/bundle.h
index b2cb6f0..5712507 100644
--- a/usr.sbin/ppp/bundle.h
+++ b/usr.sbin/ppp/bundle.h
@@ -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/command.c b/usr.sbin/ppp/command.c
index 6cf8ccf..2f2643b 100644
--- a/usr.sbin/ppp/command.c
+++ b/usr.sbin/ppp/command.c
@@ -2835,6 +2835,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,
@@ -2866,9 +2869,9 @@ static struct cmdtab const NegotiateCommands[] = {
"disable|enable", (const void *)OPT_UTMP},
#ifndef NOINET6
-#define OPT_MAX 13 /* accept/deny allowed below and not above */
+#define OPT_MAX 14 /* accept/deny allowed below and not above */
#else
-#define OPT_MAX 11
+#define OPT_MAX 12
#endif
{"acfcomp", NULL, NegotiateSet, LOCAL_AUTH | LOCAL_CX,
diff --git a/usr.sbin/ppp/datalink.c b/usr.sbin/ppp/datalink.c
index 9f14485..085e9c4 100644
--- a/usr.sbin/ppp/datalink.c
+++ b/usr.sbin/ppp/datalink.c
@@ -961,7 +961,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.8.m4 b/usr.sbin/ppp/ppp.8.m4
index d9f6e3c..b3bf5ec 100644
--- a/usr.sbin/ppp/ppp.8.m4
+++ b/usr.sbin/ppp/ppp.8.m4
@@ -154,11 +154,17 @@ This is useful if you wish to control
.Nm Ns No '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
.Dq 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
@@ -169,8 +175,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
@@ -2936,6 +2944,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
OpenPOWER on IntegriCloud