From d429ea44eab2435ddca3fbc383d024b971e24b88 Mon Sep 17 00:00:00 2001 From: rwatson Date: Fri, 2 Aug 2002 20:45:27 +0000 Subject: 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 --- sys/netinet/ip_input.c | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- cgit v1.1