aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2002-09-18 19:50:48 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2002-09-18 19:50:48 +0000
commit2201e1b039774ef6387bc538aa7597f9e8d9fe9b (patch)
tree38b1a54d7cab0b60a018983d8dcfe555ace02b49 /sys
parentf0e2422b1b5d52edd116e8480dadc698000b6be5 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if_ethersubr.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index b622d9e1334f..ba254c888296 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 */