openbsd_network: Increment the OPACKETS counter in ifq_dequeue.

Otherwise it's never incremented, and the number of transmitted
packets in ifconfig would stay 0.
This commit is contained in:
Augustin Cavalier
2025-09-08 13:12:27 -04:00
parent 508ff7e831
commit cac7959664
@@ -29,13 +29,20 @@ ifq_enqueue(struct ifaltq *ifq, struct mbuf *m)
return 0;
}
static struct mbuf*
ifq_dequeue(struct ifaltq *ifq)
ifq_dequeue_openbsd(if_t ifp, struct ifaltq *ifq)
{
struct mbuf* m = NULL;
IF_DEQUEUE(ifq, m);
if (m != NULL && ifq == &ifp->if_snd) {
// OpenBSD drivers don't increment the OPACKETS counter directly,
// so we do it here.
if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
}
return m;
}
#define ifq_dequeue(IFQ) ifq_dequeue_openbsd(ifp, IFQ)
#ifndef __cplusplus