From 4801e9aee9baec5543d3d78abf1d7432044173fe Mon Sep 17 00:00:00 2001 From: rwatson Date: Sun, 12 Apr 2009 13:22:33 +0000 Subject: Update stats in struct icmpstat and icmp6stat using four new macros: ICMPSTAT_ADD(), ICMPSTAT_INC(), ICMP6STAT_ADD(), and ICMP6STAT_INC(), rather than directly manipulating the fields of these structures across the kernel. This will make it easier to change the implementation of these statistics, such as using per-CPU versions of the data structures. In on case, icmp6stat members are manipulated indirectly, by icmp6_errcount(), and this will require further work to fix for per-CPU stats. MFC after: 3 days --- sys/contrib/pf/net/pf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys/contrib') diff --git a/sys/contrib/pf/net/pf.c b/sys/contrib/pf/net/pf.c index 7ecc2d3..71b7bda 100644 --- a/sys/contrib/pf/net/pf.c +++ b/sys/contrib/pf/net/pf.c @@ -6647,14 +6647,14 @@ pf_check_proto_cksum(struct mbuf *m, int off, int len, u_int8_t p, sa_family_t a case IPPROTO_ICMP: { INIT_VNET_INET(curvnet); - V_icmpstat.icps_checksum++; + ICMPSTAT_INC(icps_checksum); break; } #ifdef INET6 case IPPROTO_ICMPV6: { INIT_VNET_INET6(curvnet); - V_icmp6stat.icp6s_checksum++; + ICMP6STAT_INC(icp6s_checksum); break; } #endif /* INET6 */ @@ -6747,11 +6747,11 @@ pf_check_proto_cksum(struct mbuf *m, int off, int len, u_int8_t p, UDPSTAT_INC(udps_badsum); break; case IPPROTO_ICMP: - V_icmpstat.icps_checksum++; + ICMPSTAT_INC(icps_checksum); break; #ifdef INET6 case IPPROTO_ICMPV6: - V_icmp6stat.icp6s_checksum++; + ICMP6STAT_INC(icp6s_checksum); break; #endif /* INET6 */ } -- cgit v1.1