diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if_ethersubr.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index b622d9e..ba254c8 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -566,19 +566,14 @@ ether_input(struct ifnet *ifp, struct ether_header *eh, struct mbuf *m) m_freem(m); return; } + if (ifp->if_bpf != NULL) + bpf_mtap(ifp, m); m->m_pkthdr.rcvif = ifp; eh = mtod(m, struct ether_header *); m->m_data += sizeof(struct ether_header); m->m_len -= sizeof(struct ether_header); m->m_pkthdr.len = m->m_len; - } - -#ifdef MAC - mac_create_mbuf_from_ifnet(ifp, m); -#endif - - /* Check for a BPF tap */ - if (ifp->if_bpf != NULL) { + } else if (ifp->if_bpf != NULL) { struct m_hdr mh; /* This kludge is OK; BPF treats the "mbuf" as read-only */ @@ -588,6 +583,10 @@ ether_input(struct ifnet *ifp, struct ether_header *eh, struct mbuf *m) bpf_mtap(ifp, (struct mbuf *)&mh); } +#ifdef MAC + mac_create_mbuf_from_ifnet(ifp, m); +#endif + ifp->if_ibytes += m->m_pkthdr.len + sizeof (*eh); /* Handle ng_ether(4) processing, if any */ |