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.73.2.1 retrieving revision 1.73.2.1.2.3 diff -u -p -r1.73.2.1 -r1.73.2.1.2.3 --- src/sys/netinet6/ip6_input.c 2004/05/28 07:23:48 1.73.2.1 +++ src/sys/netinet6/ip6_input.c 2007/06/04 19:22:52 1.73.2.1.2.3 @@ -1,4 +1,4 @@ -/* $NetBSD: ip6_input.c,v 1.73.2.1 2004/05/28 07:23:48 tron Exp $ */ +/* $NetBSD: ip6_input.c,v 1.73.2.1.2.3 2007/06/04 19:22:52 bouyer 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.73.2.1 2004/05/28 07:23:48 tron Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.73.2.1.2.3 2007/06/04 19:22:52 bouyer Exp $"); #include "opt_inet.h" #include "opt_ipsec.h" @@ -1015,6 +1015,11 @@ ip6_savecontrol(in6p, mp, ip6, m) mp = &(*mp)->m_next; } #endif + + /* some OSes call this logic with IPv4 packet, for SO_TIMESTAMP */ + if ((ip6->ip6_vfc & IPV6_VERSION_MASK) != IPV6_VERSION) + return; + if (in6p->in6p_flags & IN6P_RECVDSTADDR) { *mp = sbcreatecontrol((caddr_t) &ip6->ip6_dst, sizeof(struct in6_addr), IPV6_RECVDSTADDR, IPPROTO_IPV6); @@ -1435,6 +1440,31 @@ u_char inet6ctlerrmap[PRC_NCMDS] = { ENOPROTOOPT }; +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; +} + SYSCTL_SETUP(sysctl_net_inet6_ip6_setup, "sysctl net.inet6.ip6 subtree setup") { @@ -1664,4 +1694,11 @@ SYSCTL_SETUP(sysctl_net_inet6_ip6_setup, NULL, 0, &ip6_maxfrags, 0, CTL_NET, PF_INET6, IPPROTO_IPV6, IPV6CTL_MAXFRAGS, CTL_EOL); + 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); }