summaryrefslogtreecommitdiffstats
path: root/sys/net/if_gre.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2014-09-19 10:39:58 +0000
committerglebius <glebius@FreeBSD.org>2014-09-19 10:39:58 +0000
commitf2cafe032fb0458df9700d4be388254503d981a8 (patch)
treeae7a412373b8b159264640a0e35e6f3eaac332a7 /sys/net/if_gre.c
parentcedd8768c45365d18dba14cb214c1bd79a7a3c57 (diff)
downloadFreeBSD-src-f2cafe032fb0458df9700d4be388254503d981a8.zip
FreeBSD-src-f2cafe032fb0458df9700d4be388254503d981a8.tar.gz
Mechanically convert to if_inc_counter().
Diffstat (limited to 'sys/net/if_gre.c')
-rw-r--r--sys/net/if_gre.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c
index fe648ea..65b3029 100644
--- a/sys/net/if_gre.c
+++ b/sys/net/if_gre.c
@@ -361,7 +361,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
* be encapsulated.
*/
if (ip->ip_off & htons(IP_MF | IP_OFFMASK)) {
- ifp->if_oerrors++;
+ if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
m_freem(m);
error = EINVAL; /* is there better errno? */
goto end;
@@ -390,7 +390,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
if ((m->m_data - msiz) < m->m_pktdat) {
m0 = m_gethdr(M_NOWAIT, MT_DATA);
if (m0 == NULL) {
- ifp->if_oerrors++;
+ if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
m_freem(m);
error = ENOBUFS;
goto end;
@@ -415,7 +415,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
memcpy((caddr_t)(ip + 1), &mob_h, (unsigned)msiz);
ip->ip_len = htons(ntohs(ip->ip_len) + msiz);
} else { /* AF_INET */
- ifp->if_oerrors++;
+ if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
m_freem(m);
error = EINVAL;
goto end;
@@ -440,7 +440,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
break;
#endif
default:
- ifp->if_oerrors++;
+ if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
m_freem(m);
error = EAFNOSUPPORT;
goto end;
@@ -452,14 +452,14 @@ gre_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
hdrlen += sizeof(uint32_t);
M_PREPEND(m, hdrlen, M_NOWAIT);
} else {
- ifp->if_oerrors++;
+ if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
m_freem(m);
error = EINVAL;
goto end;
}
if (m == NULL) { /* mbuf allocation failed */
- ifp->if_oerrors++;
+ if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
error = ENOBUFS;
goto end;
}
@@ -494,8 +494,8 @@ gre_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
gh->gi_len = htons(m->m_pkthdr.len);
}
- ifp->if_opackets++;
- ifp->if_obytes += m->m_pkthdr.len;
+ if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
+ if_inc_counter(ifp, IFCOUNTER_OBYTES, m->m_pkthdr.len);
/*
* Send it off and with IP_FORWARD flag to prevent it from
* overwriting the ip_id again. ip_id is already set to the
@@ -505,7 +505,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
(struct ip_moptions *)NULL, (struct inpcb *)NULL);
end:
if (error)
- ifp->if_oerrors++;
+ if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
return (error);
}
OpenPOWER on IntegriCloud