summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_icmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet/ip_icmp.c')
-rw-r--r--sys/netinet/ip_icmp.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c
index b7906e3..fcb9ca6 100644
--- a/sys/netinet/ip_icmp.c
+++ b/sys/netinet/ip_icmp.c
@@ -172,6 +172,20 @@ icmp_init(void)
}
/*
+ * Kernel module interface for updating icmpstat. The argument is an index
+ * into icmpstat treated as an array of u_long. While this encodes the
+ * general layout of icmpstat 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_icmpstat_inc(int statnum)
+{
+
+ (*((u_long *)&V_icmpstat + statnum))++;
+}
+
+/*
* Generate an error packet of type error
* in response to bad packet ip.
*/
OpenPOWER on IntegriCloud