PERFORCE change 22136 for review
Robert Watson
rwatson at freebsd.org
Tue Dec 10 16:36:11 GMT 2002
http://perforce.freebsd.org/chv.cgi?CH=22136
Change 22136 by rwatson at rwatson_tislabs on 2002/12/10 08:35:53
Tweak the way we special case the evil in the loopback
interface to deal with improper mbuf header copying.
Affected files ...
.. //depot/projects/trustedbsd/mac/sys/net/if_loop.c#13 edit
Differences ...
==== //depot/projects/trustedbsd/mac/sys/net/if_loop.c#13 (text+ko) ====
@@ -205,10 +205,6 @@
return (rt->rt_flags & RTF_BLACKHOLE ? 0 :
rt->rt_flags & RTF_HOST ? EHOSTUNREACH : ENETUNREACH);
}
-#if 0
- /*
- * XXXMAC: this needs to use M_COPY_PKTHDR(), among other things.
- */
/*
* KAME requires that the packet to be contiguous on the
@@ -228,13 +224,18 @@
goto contiguousfail;
}
-#ifdef MAC
- mac_create_mbuf_from_mbuf(m, n);
-#endif
m_copydata(m, 0, m->m_pkthdr.len, mtod(n, caddr_t));
n->m_pkthdr = m->m_pkthdr;
n->m_len = m->m_pkthdr.len;
SLIST_INIT(&m->m_pkthdr.tags);
+#ifdef MAC
+ /*
+ * XXXMAC: Once we put labels in tags and proper
+ * primitives are used for relocating mbuf header
+ * data, this will no longer be required.
+ */
+ mac_init_mbuf(m, M_WAITOK);
+#endif
m_freem(m);
m = n;
}
@@ -242,7 +243,6 @@
contiguousfail:
printf("looutput: mbuf allocation failed\n");
}
-#endif
ifp->if_opackets++;
ifp->if_obytes += m->m_pkthdr.len;
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message
More information about the trustedbsd-cvs
mailing list