diff options
| author | Kristof Provost <kp@FreeBSD.org> | 2026-04-21 09:19:26 +0000 |
|---|---|---|
| committer | Kristof Provost <kp@FreeBSD.org> | 2026-04-21 09:51:29 +0000 |
| commit | 07a3501e6c85baa4236061f8af4c2772307835f4 (patch) | |
| tree | 63842fee051e30d923da24b201bfd674a9ab55bb /sys/net | |
| parent | 9933bdcb12641839b7396ccd0c6b8a2d55d12744 (diff) | |
Diffstat (limited to 'sys/net')
| -rw-r--r-- | sys/net/if_loop.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c index 2ff265d5d1e7..33ddd3a8540e 100644 --- a/sys/net/if_loop.c +++ b/sys/net/if_loop.c @@ -276,6 +276,7 @@ int if_simloop(struct ifnet *ifp, struct mbuf *m, int af, int hlen) { int isr; + int32_t len; M_ASSERTPKTHDR(m); m_tag_delete_nonpersistent(m); @@ -350,9 +351,10 @@ if_simloop(struct ifnet *ifp, struct mbuf *m, int af, int hlen) m_freem(m); return (EAFNOSUPPORT); } + len = m->m_pkthdr.len; if (netisr_queue(isr, m) == 0) { if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); - if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); + if_inc_counter(ifp, IFCOUNTER_IBYTES, len); } else { /* mbuf is free'd on failure. */ if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); |
