aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/ip_divert.c
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2009-04-11 23:35:20 +0000
committerRobert Watson <rwatson@FreeBSD.org>2009-04-11 23:35:20 +0000
commit86425c62a0067a5c61d3c87ab5f3a489e3c4fd25 (patch)
tree10c5a6d474eb50a7cbc30483b13c043872a03382 /sys/netinet/ip_divert.c
parent7970a637214dd5ff99c91eaa47ffe0a63e57f362 (diff)
downloadsrc-86425c62a0067a5c61d3c87ab5f3a489e3c4fd25.tar.gz
src-86425c62a0067a5c61d3c87ab5f3a489e3c4fd25.zip
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
Notes
Notes: svn path=/head/; revision=190951
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 c2e31916c46b..f39c655f90bb 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;
}