aboutsummaryrefslogtreecommitdiff
path: root/sys/net/if_ethersubr.c
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2003-07-13 20:32:58 +0000
committerRobert Watson <rwatson@FreeBSD.org>2003-07-13 20:32:58 +0000
commit533d8562e4442fb12845ba2100d0e92e01e9632f (patch)
tree3a77ae0327a2bf4c1e535a20a5f183d188aabba1 /sys/net/if_ethersubr.c
parentbc8aff4484888b90f6974941229ac308ea0fd8f1 (diff)
downloadsrc-533d8562e4442fb12845ba2100d0e92e01e9632f.tar.gz
src-533d8562e4442fb12845ba2100d0e92e01e9632f.zip
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
Notes
Notes: svn path=/head/; revision=117518
Diffstat (limited to 'sys/net/if_ethersubr.c')
-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 541ef4363d8c..d0617c32d292 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 */