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/netinet/udp_usrreq.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/netinet/udp_usrreq.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.171.2.4 retrieving revision 1.173 diff -u -p -r1.171.2.4 -r1.173 --- src/sys/netinet/udp_usrreq.c 2010/03/11 15:04:29 1.171.2.4 +++ src/sys/netinet/udp_usrreq.c 2008/08/06 15:01:23 1.173 @@ -1,4 +1,4 @@ -/* $NetBSD: udp_usrreq.c,v 1.171.2.4 2010/03/11 15:04:29 yamt Exp $ */ +/* $NetBSD: udp_usrreq.c,v 1.173 2008/08/06 15:01:23 plunky Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -61,10 +61,9 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.171.2.4 2010/03/11 15:04:29 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.173 2008/08/06 15:01:23 plunky Exp $"); #include "opt_inet.h" -#include "opt_compat_netbsd.h" #include "opt_ipsec.h" #include "opt_inet_csum.h" #include "opt_ipkdb.h" @@ -137,10 +136,6 @@ __KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c #include #endif /* IPSEC */ -#ifdef COMPAT_50 -#include -#endif - #ifdef IPKDB #include #endif @@ -232,14 +227,10 @@ EVCNT_ATTACH_STATIC(udp6_swcsum); #endif /* UDP_CSUM_COUNTERS */ -static void sysctl_net_inet_udp_setup(struct sysctllog **); - void udp_init(void) { - sysctl_net_inet_udp_setup(NULL); - in_pcbinit(&udbtable, udbhashsize, udbhashsize); MOWNER_ATTACH(&udp_tx_mowner); @@ -417,18 +408,18 @@ udp_input(struct mbuf *m, ...) if (IN_MULTICAST(ip->ip_dst.s_addr) || n == 0) { struct sockaddr_in6 src6, dst6; - memset(&src6, 0, sizeof(src6)); + bzero(&src6, sizeof(src6)); src6.sin6_family = AF_INET6; src6.sin6_len = sizeof(struct sockaddr_in6); src6.sin6_addr.s6_addr[10] = src6.sin6_addr.s6_addr[11] = 0xff; - memcpy(&src6.sin6_addr.s6_addr[12], &ip->ip_src, + bcopy(&ip->ip_src, &src6.sin6_addr.s6_addr[12], sizeof(ip->ip_src)); src6.sin6_port = uh->uh_sport; - memset(&dst6, 0, sizeof(dst6)); + bzero(&dst6, sizeof(dst6)); dst6.sin6_family = AF_INET6; dst6.sin6_len = sizeof(struct sockaddr_in6); dst6.sin6_addr.s6_addr[10] = dst6.sin6_addr.s6_addr[11] = 0xff; - memcpy(&dst6.sin6_addr.s6_addr[12], &ip->ip_dst, + bcopy(&ip->ip_dst, &dst6.sin6_addr.s6_addr[12], sizeof(ip->ip_dst)); dst6.sin6_port = uh->uh_dport; @@ -584,12 +575,12 @@ udp6_input(struct mbuf **mp, int *offp, /* * Construct source and dst sockaddrs. */ - memset(&src, 0, sizeof(src)); + bzero(&src, sizeof(src)); src.sin6_family = AF_INET6; src.sin6_len = sizeof(struct sockaddr_in6); src.sin6_addr = ip6->ip6_src; src.sin6_port = uh->uh_sport; - memset(&dst, 0, sizeof(dst)); + bzero(&dst, sizeof(dst)); dst.sin6_family = AF_INET6; dst.sin6_len = sizeof(struct sockaddr_in6); dst.sin6_addr = ip6->ip6_dst; @@ -648,9 +639,6 @@ udp4_sendup(struct mbuf *m, int off /* o if ((n = m_copypacket(m, M_DONTWAIT)) != NULL) { if (inp && (inp->inp_flags & INP_CONTROLOPTS -#ifdef SO_OTIMESTAMP - || so->so_options & SO_OTIMESTAMP -#endif || so->so_options & SO_TIMESTAMP)) { struct ip *ip = mtod(n, struct ip *); ip_savecontrol(inp, &opts, ip, n); @@ -698,10 +686,7 @@ udp6_sendup(struct mbuf *m, int off /* o if ((n = m_copypacket(m, M_DONTWAIT)) != NULL) { if (in6p && (in6p->in6p_flags & IN6P_CONTROLOPTS -#ifdef SO_OTIMESTAMP - || in6p->in6p_socket->so_options & SO_OTIMESTAMP -#endif - || in6p->in6p_socket->so_options & SO_TIMESTAMP)) { + || in6p->in6p_socket->so_options & SO_TIMESTAMP)) { struct ip6_hdr *ip6 = mtod(n, struct ip6_hdr *); ip6_savecontrol(in6p, &opts, ip6, n); } @@ -840,12 +825,6 @@ udp4_realinput(struct sockaddr_in *src, } #endif - /* - * Check the minimum TTL for socket. - */ - if (mtod(m, struct ip *)->ip_ttl < inp->inp_ip_minttl) - goto bad; - udp4_sendup(m, off, (struct sockaddr *)src, inp->inp_socket); rcvcnt++; } @@ -1371,8 +1350,7 @@ sysctl_net_inet_udp_stats(SYSCTLFN_ARGS) /* * Sysctl for udp variables. */ -static void -sysctl_net_inet_udp_setup(struct sysctllog **clog) +SYSCTL_SETUP(sysctl_net_inet_udp_setup, "sysctl net.inet.udp subtree setup") { sysctl_createv(clog, 0, NULL, NULL,