summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_input.c
diff options
context:
space:
mode:
authorguido <guido@FreeBSD.org>1998-02-16 19:23:58 +0000
committerguido <guido@FreeBSD.org>1998-02-16 19:23:58 +0000
commit11fbae904270b422a9ad9544d95c00a56f74e51e (patch)
tree85ff70e93b1762db61ccff30e92c917bf844db79 /sys/netinet/ip_input.c
parent620810fd0c96fb2b15a15ba8c21d11892452e1d8 (diff)
downloadFreeBSD-src-11fbae904270b422a9ad9544d95c00a56f74e51e.zip
FreeBSD-src-11fbae904270b422a9ad9544d95c00a56f74e51e.tar.gz
Add new sysctl variable: net.inet.ip.accept_sourceroute
It controls if the system is to accept source routed packets. It used to be such that, no matter if the setting of net.inet.ip.sourceroute, source routed packets destined at us would be accepted. Now it is controllable with eth default set to NOT accept those.
Diffstat (limited to 'sys/netinet/ip_input.c')
-rw-r--r--sys/netinet/ip_input.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index c9a21ae..8449070 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;
}
OpenPOWER on IntegriCloud