summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2003-07-13 20:32:58 +0000
committerrwatson <rwatson@FreeBSD.org>2003-07-13 20:32:58 +0000
commit19480bfa11ff63554bd04cbf7b3a5efa162cad64 (patch)
tree3a77ae0327a2bf4c1e535a20a5f183d188aabba1 /sys/net
parent06d9cc33dc7e14d9c3938def6407d36dc327d8d3 (diff)
downloadFreeBSD-src-19480bfa11ff63554bd04cbf7b3a5efa162cad64.zip
FreeBSD-src-19480bfa11ff63554bd04cbf7b3a5efa162cad64.tar.gz
Move the MAC entry point to label ethernet-sourced mbufs with a MAC label
from the network interface earlier in ether_input(). At some point (no fingers pointed), things were restructured and the labeling operation moved later. This wasn't a problem as BPF_MTAP() relies on the ifnet label not the mbuf label, but there might have been other problems. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_ethersubr.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index 541ef43..d0617c3 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -510,6 +510,14 @@ ether_input(struct ifnet *ifp, struct mbuf *m)
}
#endif
+#ifdef MAC
+ /*
+ * Tag the mbuf with an appropriate MAC label before any other
+ * consumers can get to it.
+ */
+ mac_create_mbuf_from_ifnet(ifp, m);
+#endif
+
/*
* Give bpf a chance at the packet.
*/
@@ -529,10 +537,6 @@ ether_input(struct ifnet *ifp, struct mbuf *m)
m->m_flags &= ~M_HASFCS;
}
-#ifdef MAC
- mac_create_mbuf_from_ifnet(ifp, m);
-#endif
-
ifp->if_ibytes += m->m_pkthdr.len;
/* Handle ng_ether(4) processing, if any */
OpenPOWER on IntegriCloud