aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorGuido van Rooij <guido@FreeBSD.org>1998-02-16 19:23:58 +0000
committerGuido van Rooij <guido@FreeBSD.org>1998-02-16 19:23:58 +0000
commit4fce58048dc3f2af6d8da105b24aae2b3096d6ae (patch)
treec95b0f52bc1b89c0693c78416760402ff5d05083 /sys
parent75e7ccb83de9c0aa4c507ba47cd9a378085b2302 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/in.h6
-rw-r--r--sys/netinet/ip_input.c8
2 files changed, 11 insertions, 3 deletions
diff --git a/sys/netinet/in.h b/sys/netinet/in.h
index 3f9387d29ab6..7daf7a23f426 100644
--- a/sys/netinet/in.h
+++ b/sys/netinet/in.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)in.h 8.3 (Berkeley) 1/3/94
- * $Id: in.h,v 1.26 1997/02/22 09:41:28 peter Exp $
+ * $Id: in.h,v 1.27 1997/09/25 00:34:35 wollman Exp $
*/
#ifndef _NETINET_IN_H_
@@ -303,7 +303,8 @@ struct ip_mreq {
#define IPCTL_INTRQMAXLEN 10 /* max length of netisr queue */
#define IPCTL_INTRQDROPS 11 /* number of netisr q drops */
#define IPCTL_STATS 12 /* ipstat structure */
-#define IPCTL_MAXID 13
+#define IPCTL_ACCEPTSOURCEROUTE 13 /* may accept source routed packets */
+#define IPCTL_MAXID 14
#define IPCTL_NAMES { \
{ 0, 0 }, \
@@ -319,6 +320,7 @@ struct ip_mreq {
{ "intr-queue-maxlen", CTLTYPE_INT }, \
{ "intr-queue-drops", CTLTYPE_INT }, \
{ "stats", CTLTYPE_STRUCT }, \
+ { "accept_sourceroute", CTLTYPE_INT }, \
}
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index c9a21ae18006..8449070eba32 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ip_input.c 8.2 (Berkeley) 1/4/94
- * $Id: ip_input.c,v 1.76 1998/02/11 18:43:42 guido Exp $
+ * $Id: ip_input.c,v 1.77 1998/02/12 03:37:45 ache Exp $
* $ANA: ip_input.c,v 1.5 1996/09/18 14:34:59 wollman Exp $
*/
@@ -94,6 +94,10 @@ SYSCTL_INT(_net_inet_ip, IPCTL_DEFTTL, ttl, CTLFLAG_RW,
static int ip_dosourceroute = 0;
SYSCTL_INT(_net_inet_ip, IPCTL_SOURCEROUTE, sourceroute, CTLFLAG_RW,
&ip_dosourceroute, 0, "");
+
+static int ip_acceptsourceroute = 0;
+SYSCTL_INT(_net_inet_ip, IPCTL_ACCEPTSOURCEROUTE, accept_sourceroute,
+ CTLFLAG_RW, &ip_acceptsourceroute, 0, "");
#ifdef DIAGNOSTIC
static int ipprintfs = 0;
#endif
@@ -965,6 +969,8 @@ ip_dooptions(m)
/*
* End of source route. Should be for us.
*/
+ if (!ip_acceptsourceroute)
+ goto nosourcerouting;
save_rte(cp, ip->ip_src);
break;
}