aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey V. Elsukov <ae@FreeBSD.org>2013-06-19 20:48:34 +0000
committerAndrey V. Elsukov <ae@FreeBSD.org>2013-06-19 20:48:34 +0000
commitf1d7ebfe055cf751779dcf177b06bf1206497765 (patch)
tree1e66a3ab1b61c0d9b66294554b7f5789b37eec19
parent89f5f8a61ed2db6f81947b2ae5e64f05e9913c61 (diff)
downloadsrc-f1d7ebfe055cf751779dcf177b06bf1206497765.tar.gz
src-f1d7ebfe055cf751779dcf177b06bf1206497765.zip
Use RIP6STAT_INC() macro for raw ip6 statistics accounting.
MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=252007
-rw-r--r--sys/netinet6/raw_ip6.c16
-rw-r--r--sys/netinet6/raw_ip6.h2
2 files changed, 10 insertions, 8 deletions
diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c
index 6689c71fab2b..31eeb61a29a1 100644
--- a/sys/netinet6/raw_ip6.c
+++ b/sys/netinet6/raw_ip6.c
@@ -160,7 +160,7 @@ rip6_input(struct mbuf **mp, int *offp, int proto)
struct mbuf *opts = NULL;
struct sockaddr_in6 fromsa;
- V_rip6stat.rip6s_ipackets++;
+ RIP6STAT_INC(rip6s_ipackets);
if (faithprefix_p != NULL && (*faithprefix_p)(&ip6->ip6_dst)) {
/* XXX Send icmp6 host/port unreach? */
@@ -199,11 +199,11 @@ rip6_input(struct mbuf **mp, int *offp, int proto)
}
INP_RLOCK(in6p);
if (in6p->in6p_cksum != -1) {
- V_rip6stat.rip6s_isum++;
+ RIP6STAT_INC(rip6s_isum);
if (in6_cksum(m, proto, *offp,
m->m_pkthdr.len - *offp)) {
INP_RUNLOCK(in6p);
- V_rip6stat.rip6s_badsum++;
+ RIP6STAT_INC(rip6s_badsum);
continue;
}
}
@@ -279,7 +279,7 @@ rip6_input(struct mbuf **mp, int *offp, int proto)
m_freem(n);
if (opts)
m_freem(opts);
- V_rip6stat.rip6s_fullsock++;
+ RIP6STAT_INC(rip6s_fullsock);
} else
sorwakeup(last->inp_socket);
opts = NULL;
@@ -312,14 +312,14 @@ rip6_input(struct mbuf **mp, int *offp, int proto)
m_freem(m);
if (opts)
m_freem(opts);
- V_rip6stat.rip6s_fullsock++;
+ RIP6STAT_INC(rip6s_fullsock);
} else
sorwakeup(last->inp_socket);
INP_RUNLOCK(last);
} else {
- V_rip6stat.rip6s_nosock++;
+ RIP6STAT_INC(rip6s_nosock);
if (m->m_flags & M_MCAST)
- V_rip6stat.rip6s_nosockmcast++;
+ RIP6STAT_INC(rip6s_nosockmcast);
if (proto == IPPROTO_NONE)
m_freem(m);
else {
@@ -559,7 +559,7 @@ rip6_output(m, va_alist)
icmp6_ifoutstat_inc(oifp, type, code);
ICMP6STAT_INC(icp6s_outhist[type]);
} else
- V_rip6stat.rip6s_opackets++;
+ RIP6STAT_INC(rip6s_opackets);
goto freectl;
diff --git a/sys/netinet6/raw_ip6.h b/sys/netinet6/raw_ip6.h
index 23395a67dd99..cc4bcdd0259d 100644
--- a/sys/netinet6/raw_ip6.h
+++ b/sys/netinet6/raw_ip6.h
@@ -48,6 +48,8 @@ struct rip6stat {
};
#ifdef _KERNEL
+#define RIP6STAT_ADD(name, val) V_rip6stat.name += (val)
+#define RIP6STAT_INC(name) RIP6STAT_ADD(name, 1)
VNET_DECLARE(struct rip6stat, rip6stat);
#define V_rip6stat VNET(rip6stat)
#endif