diff options
author | glebius <glebius@FreeBSD.org> | 2014-09-19 10:39:58 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2014-09-19 10:39:58 +0000 |
commit | f2cafe032fb0458df9700d4be388254503d981a8 (patch) | |
tree | ae7a412373b8b159264640a0e35e6f3eaac332a7 /sys/net/if_tun.c | |
parent | cedd8768c45365d18dba14cb214c1bd79a7a3c57 (diff) | |
download | FreeBSD-src-f2cafe032fb0458df9700d4be388254503d981a8.zip FreeBSD-src-f2cafe032fb0458df9700d4be388254503d981a8.tar.gz |
Mechanically convert to if_inc_counter().
Diffstat (limited to 'sys/net/if_tun.c')
-rw-r--r-- | sys/net/if_tun.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index e4bc2af..89af288 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -619,8 +619,8 @@ tunoutput(struct ifnet *ifp, struct mbuf *m0, const struct sockaddr *dst, /* if allocation failed drop packet */ if (m0 == NULL) { - ifp->if_iqdrops++; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return (ENOBUFS); } else { bcopy(dst, m0->m_data, dst->sa_len); @@ -633,8 +633,8 @@ tunoutput(struct ifnet *ifp, struct mbuf *m0, const struct sockaddr *dst, /* if allocation failed drop packet */ if (m0 == NULL) { - ifp->if_iqdrops++; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return (ENOBUFS); } else *(u_int32_t *)m0->m_data = htonl(af); @@ -651,7 +651,7 @@ tunoutput(struct ifnet *ifp, struct mbuf *m0, const struct sockaddr *dst, error = (ifp->if_transmit)(ifp, m0); if (error) return (ENOBUFS); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); return (0); } @@ -866,7 +866,7 @@ tunwrite(struct cdev *dev, struct uio *uio, int flag) } if ((m = m_uiotombuf(uio, M_NOWAIT, 0, 0, M_PKTHDR)) == NULL) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return (ENOBUFS); } @@ -908,8 +908,8 @@ tunwrite(struct cdev *dev, struct uio *uio, int flag) } if (harvest.point_to_point) random_harvest(&(m->m_data), 12, 2, RANDOM_NET_TUN); - ifp->if_ibytes += m->m_pkthdr.len; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); CURVNET_SET(ifp->if_vnet); M_SETFIB(m, ifp->if_fib); netisr_dispatch(isr, m); |