PERFORCE change 111169 for review

Marko Zec zec at FreeBSD.org
Tue Dec 5 16:01:19 PST 2006


http://perforce.freebsd.org/chv.cgi?CH=111169

Change 111169 by zec at zec_tpx32 on 2006/12/06 00:01:10

	Set V_loif to point to the ifnet corresponding to the "lo0"
	interface before calling if_attach() for it.  This is important
	since in rt_dispatch() we mark the looped back mbufs to have
	m_pkthdr.rcvif set to V_loif, so we should guarantee that V_loif
	will be valid at the time the first PF_ROUTE message will be
	generated.
	
	Could be also that I'm fixing symptomps here and not the
	causes, i.e. some kind of leakage between vnet instances.  XXX.

Affected files ...

.. //depot/projects/vimage/src/sys/net/if_loop.c#4 edit

Differences ...

==== //depot/projects/vimage/src/sys/net/if_loop.c#4 (text+ko) ====

@@ -157,6 +157,11 @@
 		free(sc, M_LO);
 		return (ENOSPC);
 	}
+#ifdef VIMAGE
+	ifp->if_vnetb = curvnetb;
+#endif
+	if (V_loif == NULL)
+		V_loif = ifp;
 
 	if_initname(ifp, ifc->ifc_name, unit);
 	ifp->if_mtu = LOMTU;
@@ -170,8 +175,6 @@
 	mtx_lock(&lo_mtx);
 	LIST_INSERT_HEAD(&V_lo_list, sc, sc_next);
 	mtx_unlock(&lo_mtx);
-	if (V_loif == NULL)
-		V_loif = ifp;
 
 	return (0);
 }


More information about the p4-projects mailing list