Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Oct 2007 12:51:28 GMT
From:      Marko Zec <zec@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 127337 for review
Message-ID:  <200710091251.l99CpSu4091113@repoman.freebsd.org>

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

Change 127337 by zec@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);



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