Mechanically convert to if_inc_counter().
This commit is contained in:
parent
9d204116ad
commit
94b52d99da
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=271851
@ -247,7 +247,7 @@ ng_eiface_start2(node_p node, hook_p hook, void *arg1, int arg2)
|
||||
BPF_MTAP(ifp, m);
|
||||
|
||||
if (ifp->if_flags & IFF_MONITOR) {
|
||||
ifp->if_ipackets++;
|
||||
if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
|
||||
m_freem(m);
|
||||
continue;
|
||||
}
|
||||
@ -262,9 +262,9 @@ ng_eiface_start2(node_p node, hook_p hook, void *arg1, int arg2)
|
||||
|
||||
/* Update stats */
|
||||
if (error == 0)
|
||||
ifp->if_opackets++;
|
||||
if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
|
||||
else
|
||||
ifp->if_oerrors++;
|
||||
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||
}
|
||||
|
||||
ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
|
||||
@ -597,7 +597,7 @@ ng_eiface_rcvdata(hook_p hook, item_p item)
|
||||
m->m_pkthdr.rcvif = ifp;
|
||||
|
||||
/* Update interface stats */
|
||||
ifp->if_ipackets++;
|
||||
if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
|
||||
|
||||
(*ifp->if_input)(ifp, m);
|
||||
|
||||
|
@ -396,7 +396,7 @@ ng_iface_output(struct ifnet *ifp, struct mbuf *m,
|
||||
IFQ_LOCK(&ifp->if_snd);
|
||||
IFQ_INC_DROPS(&ifp->if_snd);
|
||||
IFQ_UNLOCK(&ifp->if_snd);
|
||||
ifp->if_oerrors++;
|
||||
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||
return (ENOBUFS);
|
||||
}
|
||||
*(sa_family_t *)m->m_data = af;
|
||||
@ -472,8 +472,8 @@ ng_iface_send(struct ifnet *ifp, struct mbuf *m, sa_family_t sa)
|
||||
|
||||
/* Update stats. */
|
||||
if (error == 0) {
|
||||
ifp->if_obytes += len;
|
||||
ifp->if_opackets++;
|
||||
if_inc_counter(ifp, IFCOUNTER_OBYTES, len);
|
||||
if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
|
||||
}
|
||||
|
||||
return (error);
|
||||
@ -736,8 +736,8 @@ ng_iface_rcvdata(hook_p hook, item_p item)
|
||||
}
|
||||
|
||||
/* Update interface stats */
|
||||
ifp->if_ipackets++;
|
||||
ifp->if_ibytes += m->m_pkthdr.len;
|
||||
if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
|
||||
if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len);
|
||||
|
||||
/* Note receiving interface */
|
||||
m->m_pkthdr.rcvif = ifp;
|
||||
|
@ -364,7 +364,7 @@ ng_sppp_rcvdata (hook_p hook, item_p item)
|
||||
}
|
||||
|
||||
/* Update interface stats */
|
||||
SP2IFP(pp)->if_ipackets++;
|
||||
if_inc_counter(SP2IFP(pp), IFCOUNTER_IPACKETS, 1);
|
||||
|
||||
/* Note receiving interface */
|
||||
m->m_pkthdr.rcvif = SP2IFP(pp);
|
||||
|
Loading…
Reference in New Issue
Block a user