Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/netinet6/ip6_input.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/netinet6/ip6_input.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.99 retrieving revision 1.102 diff -u -p -r1.99 -r1.102 --- src/sys/netinet6/ip6_input.c 2007/03/23 14:24:22 1.99 +++ src/sys/netinet6/ip6_input.c 2007/04/22 19:47:41 1.102 @@ -1,4 +1,4 @@ -/* $NetBSD: ip6_input.c,v 1.99 2007/03/23 14:24:22 liamjfoy Exp $ */ +/* $NetBSD: ip6_input.c,v 1.102 2007/04/22 19:47:41 christos Exp $ */ /* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */ /* @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.99 2007/03/23 14:24:22 liamjfoy Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.102 2007/04/22 19:47:41 christos Exp $"); #include "opt_inet.h" #include "opt_inet6.h" @@ -1611,12 +1611,12 @@ ip6_delaux(m) * we could reduce this value, call ip6flow_reap(); */ static int -sysctl_net_inet_ip6_maxflows(SYSCTLFN_ARGS) +sysctl_net_inet6_ip6_maxflows(SYSCTLFN_ARGS) { int s; s = sysctl_lookup(SYSCTLFN_CALL(rnode)); - if (s) + if (s || newp == NULL) return (s); s = splsoftnet(); @@ -1656,6 +1656,31 @@ sysctl_net_inet6_ip6_hashsize(SYSCTLFN_A } #endif /* GATEWAY */ +static int +sysctl_net_inet6_ip6_rht0(SYSCTLFN_ARGS) +{ + int error, tmp; + struct sysctlnode node; + + node = *rnode; + tmp = ip6_rht0; + node.sysctl_data = &tmp; + error = sysctl_lookup(SYSCTLFN_CALL(&node)); + if (error || newp == NULL) + return error; + + switch (tmp) { + case -1: /* disable processing */ + case 0: /* disable for host, enable for router */ + case 1: /* enable for all */ + break; + default: + return EINVAL; + } + ip6_rht0 = tmp; + return 0; +} + /* * System control for IP6 */ @@ -1944,7 +1969,7 @@ SYSCTL_SETUP(sysctl_net_inet6_ip6_setup, CTLFLAG_PERMANENT|CTLFLAG_READWRITE, CTLTYPE_INT, "maxflows", SYSCTL_DESCR("Number of flows for fast forwarding (IPv6)"), - sysctl_net_inet_ip6_maxflows, 0, &ip6_maxflows, 0, + sysctl_net_inet6_ip6_maxflows, 0, &ip6_maxflows, 0, CTL_NET, PF_INET6, IPPROTO_IPV6, CTL_CREATE, CTL_EOL); sysctl_createv(clog, 0, NULL, NULL, @@ -1955,4 +1980,11 @@ SYSCTL_SETUP(sysctl_net_inet6_ip6_setup, CTL_NET, PF_INET6, IPPROTO_IPV6, CTL_CREATE, CTL_EOL); #endif + sysctl_createv(clog, 0, NULL, NULL, + CTLFLAG_PERMANENT|CTLFLAG_READWRITE, + CTLTYPE_INT, "rht0", + SYSCTL_DESCR("Processing of routing header type 0 (IPv6)"), + sysctl_net_inet6_ip6_rht0, 0, &ip6_rht0, 0, + CTL_NET, PF_INET6, IPPROTO_IPV6, + CTL_CREATE, CTL_EOL); }