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.120 retrieving revision 1.124 diff -u -p -r1.120 -r1.124 --- src/sys/netinet6/ip6_input.c 2008/08/20 18:35:20 1.120 +++ src/sys/netinet6/ip6_input.c 2009/03/18 16:00:23 1.124 @@ -1,4 +1,4 @@ -/* $NetBSD: ip6_input.c,v 1.120 2008/08/20 18:35:20 matt Exp $ */ +/* $NetBSD: ip6_input.c,v 1.124 2009/03/18 16:00:23 cegger Exp $ */ /* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */ /* @@ -62,12 +62,13 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.120 2008/08/20 18:35:20 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.124 2009/03/18 16:00:23 cegger Exp $"); #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" #include "opt_pfil_hooks.h" +#include "opt_compat_netbsd.h" #include #include @@ -120,6 +121,11 @@ __KERNEL_RCSID(0, "$NetBSD: ip6_input.c, #include #endif /* FAST_IPSEC */ +#ifdef COMPAT_50 +#include +#include +#endif + #include #include "faith.h" @@ -1102,17 +1108,27 @@ ip6_savecontrol(struct in6pcb *in6p, str #define IS2292(x, y) (y) #endif -#ifdef SO_TIMESTAMP - if (in6p->in6p_socket->so_options & SO_TIMESTAMP) { + if (in6p->in6p_socket->so_options & SO_TIMESTAMP +#ifdef SO_OTIMESTAMP + || in6p->in6p_socket->so_options & SO_OTIMESTAMP +#endif + ) { struct timeval tv; microtime(&tv); +#ifdef SO_OTIMESTAMP + if (in6p->in6p_socket->so_options & SO_OTIMESTAMP) { + struct timeval50 tv50; + timeval_to_timeval50(&tv, &tv50); + *mp = sbcreatecontrol((void *) &tv50, sizeof(tv50), + SCM_OTIMESTAMP, SOL_SOCKET); + } else +#endif *mp = sbcreatecontrol((void *) &tv, sizeof(tv), SCM_TIMESTAMP, SOL_SOCKET); if (*mp) 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) @@ -1562,7 +1578,7 @@ ip6_addaux(struct mbuf *m) M_NOWAIT); if (mtag) { m_tag_prepend(m, mtag); - bzero(mtag + 1, sizeof(struct ip6aux)); + memset(mtag + 1, 0, sizeof(struct ip6aux)); } } return mtag; @@ -1595,21 +1611,21 @@ ip6_delaux(struct mbuf *m) static int sysctl_net_inet6_ip6_maxflows(SYSCTLFN_ARGS) { - int error; + int error; - error = sysctl_lookup(SYSCTLFN_CALL(rnode)); - if (error || newp == NULL) - return (error); + error = sysctl_lookup(SYSCTLFN_CALL(rnode)); + if (error || newp == NULL) + return (error); - mutex_enter(softnet_lock); - KERNEL_LOCK_ONE(1, NULL); + mutex_enter(softnet_lock); + KERNEL_LOCK(1, NULL); - ip6flow_reap(0); + ip6flow_reap(0); KERNEL_UNLOCK_ONE(NULL); - mutex_exit(softnet_lock); + mutex_exit(softnet_lock); - return (0); + return (0); } static int @@ -1630,7 +1646,7 @@ sysctl_net_inet6_ip6_hashsize(SYSCTLFN_A * Can only fail due to malloc() */ mutex_enter(softnet_lock); - KERNEL_LOCK_ONE(1, NULL); + KERNEL_LOCK(1, NULL); error = ip6flow_invalidate_all(tmp); @@ -1639,7 +1655,7 @@ sysctl_net_inet6_ip6_hashsize(SYSCTLFN_A } else { /* * EINVAL if not a power of 2 - */ + */ error = EINVAL; }