1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00

Mechanically convert to if_inc_counter().

This commit is contained in:
Gleb Smirnoff 2014-09-19 09:19:29 +00:00
parent 56b61ca27a
commit 2a6009bfa6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=271857
2 changed files with 8 additions and 8 deletions

View File

@ -252,8 +252,8 @@ pflog_packet(struct pfi_kif *kif, struct mbuf *m, sa_family_t af, u_int8_t dir,
}
#endif /* INET */
ifn->if_opackets++;
ifn->if_obytes += m->m_pkthdr.len;
if_inc_counter(ifn, IFCOUNTER_OPACKETS, 1);
if_inc_counter(ifn, IFCOUNTER_OBYTES, m->m_pkthdr.len);
BPF_MTAP2(ifn, &hdr, PFLOG_HDRLEN, m);
return (0);

View File

@ -598,8 +598,8 @@ pfsync_input(struct mbuf **mp, int *offp __unused, int proto __unused)
goto done;
}
sc->sc_ifp->if_ipackets++;
sc->sc_ifp->if_ibytes += m->m_pkthdr.len;
if_inc_counter(sc->sc_ifp, IFCOUNTER_IPACKETS, 1);
if_inc_counter(sc->sc_ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len);
/* verify that the IP TTL is 255. */
if (ip->ip_ttl != PFSYNC_DFLTTL) {
V_pfsyncstats.pfsyncs_badttl++;
@ -1525,7 +1525,7 @@ pfsync_sendout(int schedswi)
m = m_get2(max_linkhdr + sc->sc_len, M_NOWAIT, MT_DATA, M_PKTHDR);
if (m == NULL) {
sc->sc_ifp->if_oerrors++;
if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1);
V_pfsyncstats.pfsyncs_onomem++;
return;
}
@ -1632,15 +1632,15 @@ pfsync_sendout(int schedswi)
return;
}
sc->sc_ifp->if_opackets++;
sc->sc_ifp->if_obytes += m->m_pkthdr.len;
if_inc_counter(sc->sc_ifp, IFCOUNTER_OPACKETS, 1);
if_inc_counter(sc->sc_ifp, IFCOUNTER_OBYTES, m->m_pkthdr.len);
sc->sc_len = PFSYNC_MINPKT;
if (!_IF_QFULL(&sc->sc_ifp->if_snd))
_IF_ENQUEUE(&sc->sc_ifp->if_snd, m);
else {
m_freem(m);
sc->sc_ifp->if_oqdrops++;
if_inc_counter(sc->sc_ifp, IFCOUNTER_OQDROPS, 1);
}
if (schedswi)
swi_sched(V_pfsync_swi_cookie, 0);