summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2002-08-02 20:45:27 +0000
committerrwatson <rwatson@FreeBSD.org>2002-08-02 20:45:27 +0000
commitd429ea44eab2435ddca3fbc383d024b971e24b88 (patch)
tree78b79a1ec96424bf5ab1f2b2fd95f82c8db376ff /sys
parent5d31ba7f616c557de1c58e5ee6f83d533d026ba9 (diff)
downloadFreeBSD-src-d429ea44eab2435ddca3fbc383d024b971e24b88.zip
FreeBSD-src-d429ea44eab2435ddca3fbc383d024b971e24b88.tar.gz
When preserving the IP header in extra mbuf in the IP forwarding
case, also preserve the MAC label. Note that this mbuf allocation is fairly non-optimal, but not my fault. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/ip_input.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index 8d0e232..cd38a1e 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -1690,6 +1690,13 @@ ip_forward(struct mbuf *m, int srcrt, struct sockaddr_in *next_hop)
mcopy->m_len = imin((IP_VHL_HL(ip->ip_vhl) << 2) + 8,
(int)ip->ip_len);
m_copydata(m, 0, mcopy->m_len, mtod(mcopy, caddr_t));
+#ifdef MAC
+ /*
+ * XXXMAC: This will eventually become an explicit
+ * labeling point.
+ */
+ mac_create_mbuf_from_mbuf(m, mcopy);
+#endif
}
#ifdef IPSTEALTH
OpenPOWER on IntegriCloud