-/* $OpenBSD: if.c,v 1.713 2023/12/23 10:52:54 bluhm Exp $ */
+/* $OpenBSD: if.c,v 1.714 2023/12/29 11:43:04 bluhm Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
if (ISSET(keepcksum, M_ICMP_CSUM_OUT))
m->m_pkthdr.csum_flags |= M_ICMP_CSUM_IN_OK;
- ifp->if_opackets++;
- ifp->if_obytes += m->m_pkthdr.len;
-
- ifp->if_ipackets++;
- ifp->if_ibytes += m->m_pkthdr.len;
+ if (ifp->if_counters == NULL) {
+ /* XXXSMP multicast loopback and simplex interfaces */
+ ifp->if_opackets++;
+ ifp->if_obytes += m->m_pkthdr.len;
+ } else {
+ counters_pkt(ifp->if_counters, ifc_opackets, ifc_obytes,
+ m->m_pkthdr.len);
+ }
switch (af) {
case AF_INET:
-/* $OpenBSD: if_loop.c,v 1.97 2023/07/21 22:24:41 bluhm Exp $ */
+/* $OpenBSD: if_loop.c,v 1.98 2023/12/29 11:43:04 bluhm Exp $ */
/* $NetBSD: if_loop.c,v 1.15 1996/05/07 02:40:33 thorpej Exp $ */
/*
ifp->if_output = looutput;
ifp->if_type = IFT_LOOP;
ifp->if_hdrlen = sizeof(u_int32_t);
+ if_counters_alloc(ifp);
if (unit == 0) {
if_attachhead(ifp);
if_addgroup(ifp, ifc->ifc_name);
error = if_input_local(ifp, m, m->m_pkthdr.ph_family);
if (error)
- ifp->if_ierrors++;
+ counters_inc(ifp->if_counters, ifc_ierrors);
}
int