diff options
| author | Robert Watson <rwatson@FreeBSD.org> | 2009-08-02 19:43:32 +0000 |
|---|---|---|
| committer | Robert Watson <rwatson@FreeBSD.org> | 2009-08-02 19:43:32 +0000 |
| commit | 315e3e38faa1ac7e775bbbbca0079c23fa3513ea (patch) | |
| tree | a40bf95a151eb088ca45c32ee899b724ba74dcea /sys/netinet/udp_usrreq.c | |
| parent | 9734411552a036160bfa03958256bdd3bfe6119f (diff) | |
Notes
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) { |
