diff options
Diffstat (limited to 'sys/netinet/udp_usrreq.c')
| -rw-r--r-- | sys/netinet/udp_usrreq.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 520fc949ed38..019ceb3ef281 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -203,6 +203,20 @@ udp_init(void) EVENTHANDLER_PRI_ANY); } +/* + * Kernel module interface for updating udpstat. The argument is an index + * into udpstat treated as an array of u_long. While this encodes the + * general layout of udpstat into the caller, it doesn't encode its location, + * so that future changes to add, for example, per-CPU stats support won't + * cause binary compatibility problems for kernel modules. + */ +void +kmod_udpstat_inc(int statnum) +{ + + (*((u_long *)&V_udpstat + statnum))++; +} + int udp_newudpcb(struct inpcb *inp) { |
