| version 1.168.2.1, 2008/05/18 12:35:30 |
version 1.169, 2008/04/23 06:09:05 |
|
|
| MOWNER_ATTACH(&udp_rx_mowner); |
MOWNER_ATTACH(&udp_rx_mowner); |
| MOWNER_ATTACH(&udp_mowner); |
MOWNER_ATTACH(&udp_mowner); |
| |
|
| #ifdef INET |
|
| udpstat_percpu = percpu_alloc(sizeof(uint64_t) * UDP_NSTATS); |
udpstat_percpu = percpu_alloc(sizeof(uint64_t) * UDP_NSTATS); |
| #endif |
|
| #ifdef INET6 |
|
| udp6stat_percpu = percpu_alloc(sizeof(uint64_t) * UDP6_NSTATS); |
|
| #endif |
|
| } |
} |
| |
|
| /* |
/* |
| Line 1186 udp_usrreq(struct socket *so, int req, s |
|
| Line 1181 udp_usrreq(struct socket *so, int req, s |
|
| s = splsoftnet(); |
s = splsoftnet(); |
| |
|
| if (req == PRU_PURGEIF) { |
if (req == PRU_PURGEIF) { |
| mutex_enter(softnet_lock); |
|
| in_pcbpurgeif0(&udbtable, (struct ifnet *)control); |
in_pcbpurgeif0(&udbtable, (struct ifnet *)control); |
| in_purgeif((struct ifnet *)control); |
in_purgeif((struct ifnet *)control); |
| in_pcbpurgeif(&udbtable, (struct ifnet *)control); |
in_pcbpurgeif(&udbtable, (struct ifnet *)control); |
| mutex_exit(softnet_lock); |
|
| splx(s); |
splx(s); |
| return (0); |
return (0); |
| } |
} |
| Line 1200 udp_usrreq(struct socket *so, int req, s |
|
| Line 1193 udp_usrreq(struct socket *so, int req, s |
|
| if (req != PRU_SEND && req != PRU_SENDOOB && control) |
if (req != PRU_SEND && req != PRU_SENDOOB && control) |
| panic("udp_usrreq: unexpected control mbuf"); |
panic("udp_usrreq: unexpected control mbuf"); |
| #endif |
#endif |
| if (req == PRU_ATTACH) { |
if (inp == 0 && req != PRU_ATTACH) { |
| sosetlock(so); |
|
| } else if (inp == 0) { |
|
| error = EINVAL; |
error = EINVAL; |
| goto release; |
goto release; |
| } |
} |
|
|
| static int |
static int |
| sysctl_net_inet_udp_stats(SYSCTLFN_ARGS) |
sysctl_net_inet_udp_stats(SYSCTLFN_ARGS) |
| { |
{ |
| |
netstat_sysctl_context ctx; |
| |
uint64_t udps[UDP_NSTATS]; |
| |
|
| return (NETSTAT_SYSCTL(udpstat_percpu, UDP_NSTATS)); |
ctx.ctx_stat = udpstat_percpu; |
| |
ctx.ctx_counters = udps; |
| |
ctx.ctx_ncounters = UDP_NSTATS; |
| |
return (NETSTAT_SYSCTL(&ctx)); |
| } |
} |
| |
|
| /* |
/* |