PERFORCE change 127337 for review

Marko Zec zec at FreeBSD.org
Tue Oct 9 05:51:29 PDT 2007


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

Change 127337 by zec at zec_tpx32 on 2007/10/09 12:50:27

	When reassign an ifnet to another vnet, clean up a reference
	to it in the old vnet's ifindex_table[].

Affected files ...

.. //depot/projects/vimage/src/sys/kern/kern_vimage.c#39 edit

Differences ...

==== //depot/projects/vimage/src/sys/kern/kern_vimage.c#39 (text+ko) ====

@@ -351,6 +351,15 @@
 		/* if_detach(ifp); */
 	}
 	ifp->if_bpf = NULL;
+	/* do/while construct needed to confine scope of INIT_VNET_NET() */
+	do {
+		INIT_VNET_NET(curvnet);
+
+		ifnet_byindex(ifp->if_index) = NULL;
+		/* XXX: should be locked with if_findindex() */
+		while (V_if_index > 0 && ifnet_byindex(V_if_index) == NULL)
+			V_if_index--;
+	} while (0);
 
 	CURVNET_SET_QUIET(new_vnet);
 	INIT_VNET_NET(new_vnet);


More information about the p4-projects mailing list