summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_divert.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2009-04-11 23:35:20 +0000
committerrwatson <rwatson@FreeBSD.org>2009-04-11 23:35:20 +0000
commit692f8aa2fac966ef1adc29843ad741d355db1ecd (patch)
tree10c5a6d474eb50a7cbc30483b13c043872a03382 /sys/netinet/ip_divert.c
parent000707192e4b75299e3d0c78425c7da549319f08 (diff)
downloadFreeBSD-src-692f8aa2fac966ef1adc29843ad741d355db1ecd.zip
FreeBSD-src-692f8aa2fac966ef1adc29843ad741d355db1ecd.tar.gz
Update stats in struct ipstat using four new macros, IPSTAT_ADD(),
IPSTAT_INC(), IPSTAT_SUB(), and IPSTAT_DEC(), rather than directly manipulating the fields 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. MFC after: 3 days
Diffstat (limited to 'sys/netinet/ip_divert.c')
-rw-r--r--sys/netinet/ip_divert.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c
index c2e3191..f39c655 100644
--- a/sys/netinet/ip_divert.c
+++ b/sys/netinet/ip_divert.c
@@ -186,7 +186,7 @@ div_input(struct mbuf *m, int off)
{
INIT_VNET_INET(curvnet);
- V_ipstat.ips_noproto++;
+ IPSTAT_INC(ips_noproto);
m_freem(m);
}
@@ -307,8 +307,8 @@ divert_packet(struct mbuf *m, int incoming)
INP_INFO_RUNLOCK(&V_divcbinfo);
if (sa == NULL) {
m_freem(m);
- V_ipstat.ips_noproto++;
- V_ipstat.ips_delivered--;
+ IPSTAT_INC(ips_noproto);
+ IPSTAT_DEC(ips_delivered);
}
}
@@ -394,7 +394,7 @@ div_output(struct socket *so, struct mbuf *m, struct sockaddr_in *sin,
ip->ip_off = ntohs(ip->ip_off);
/* Send packet to output processing */
- V_ipstat.ips_rawout++; /* XXX */
+ IPSTAT_INC(ips_rawout); /* XXX */
#ifdef MAC
mac_inpcb_create_mbuf(inp, m);
@@ -570,7 +570,7 @@ div_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam,
/* Packet must have a header (but that's about it) */
if (m->m_len < sizeof (struct ip) &&
(m = m_pullup(m, sizeof (struct ip))) == 0) {
- V_ipstat.ips_toosmall++;
+ IPSTAT_INC(ips_toosmall);
m_freem(m);
return EINVAL;
}
OpenPOWER on IntegriCloud