version 1.177, 2009/04/18 14:58:05 |
version 1.179.6.1, 2011/06/06 09:09:57 |
Line 232 EVCNT_ATTACH_STATIC(udp6_swcsum); |
|
Line 232 EVCNT_ATTACH_STATIC(udp6_swcsum); |
|
|
|
#endif /* UDP_CSUM_COUNTERS */ |
#endif /* UDP_CSUM_COUNTERS */ |
|
|
|
static void sysctl_net_inet_udp_setup(struct sysctllog **); |
|
|
void |
void |
udp_init(void) |
udp_init(void) |
{ |
{ |
|
|
|
sysctl_net_inet_udp_setup(NULL); |
|
|
in_pcbinit(&udbtable, udbhashsize, udbhashsize); |
in_pcbinit(&udbtable, udbhashsize, udbhashsize); |
|
|
MOWNER_ATTACH(&udp_tx_mowner); |
MOWNER_ATTACH(&udp_tx_mowner); |
Line 800 udp4_realinput(struct sockaddr_in *src, |
|
Line 804 udp4_realinput(struct sockaddr_in *src, |
|
/* |
/* |
* Locate pcb for datagram. |
* Locate pcb for datagram. |
*/ |
*/ |
inp = in_pcblookup_connect(&udbtable, *src4, *sport, *dst4, *dport); |
inp = in_pcblookup_connect(&udbtable, *src4, *sport, *dst4, |
|
*dport, 0); |
if (inp == 0) { |
if (inp == 0) { |
UDP_STATINC(UDP_STAT_PCBHASHMISS); |
UDP_STATINC(UDP_STAT_PCBHASHMISS); |
inp = in_pcblookup_bind(&udbtable, *dst4, *dport); |
inp = in_pcblookup_bind(&udbtable, *dst4, *dport); |
Line 836 udp4_realinput(struct sockaddr_in *src, |
|
Line 841 udp4_realinput(struct sockaddr_in *src, |
|
} |
} |
#endif |
#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); |
udp4_sendup(m, off, (struct sockaddr *)src, inp->inp_socket); |
rcvcnt++; |
rcvcnt++; |
} |
} |
Line 948 udp6_realinput(int af, struct sockaddr_i |
|
Line 959 udp6_realinput(int af, struct sockaddr_i |
|
* Locate pcb for datagram. |
* Locate pcb for datagram. |
*/ |
*/ |
in6p = in6_pcblookup_connect(&udbtable, &src6, sport, dst6, |
in6p = in6_pcblookup_connect(&udbtable, &src6, sport, dst6, |
dport, 0); |
dport, 0, 0); |
if (in6p == 0) { |
if (in6p == 0) { |
UDP_STATINC(UDP_STAT_PCBHASHMISS); |
UDP_STATINC(UDP_STAT_PCBHASHMISS); |
in6p = in6_pcblookup_bind(&udbtable, dst6, dport, 0); |
in6p = in6_pcblookup_bind(&udbtable, dst6, dport, 0); |
Line 1361 sysctl_net_inet_udp_stats(SYSCTLFN_ARGS) |
|
Line 1372 sysctl_net_inet_udp_stats(SYSCTLFN_ARGS) |
|
/* |
/* |
* Sysctl for udp variables. |
* Sysctl for udp variables. |
*/ |
*/ |
SYSCTL_SETUP(sysctl_net_inet_udp_setup, "sysctl net.inet.udp subtree setup") |
static void |
|
sysctl_net_inet_udp_setup(struct sysctllog **clog) |
{ |
{ |
|
|
sysctl_createv(clog, 0, NULL, NULL, |
sysctl_createv(clog, 0, NULL, NULL, |