Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Dec 2002 08:36:11 -0800 (PST)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 22136 for review
Message-ID:  <200212101636.gBAGaB6Y083280@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=22136

Change 22136 by rwatson@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@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200212101636.gBAGaB6Y083280>