Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Jun 2009 14:04:27 GMT
From:      Marko Zec <zec@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 163487 for review
Message-ID:  <200906041404.n54E4RQT086003@repoman.freebsd.org>

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

Change 163487 by zec@zec_amdx4 on 2009/06/04 14:03:58

	Allow for lo0 to be automatically destroyed via the vnet
	destructor framework.
	
	ifconfig lo0 destroy still works with unchanged semantics,
	i.e. returns an error and can never succeed.

Affected files ...

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

Differences ...

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

@@ -135,12 +135,11 @@
 static void
 lo_clone_destroy(struct ifnet *ifp)
 {
-#ifdef INVARIANTS
-	INIT_VNET_NET(ifp->if_vnet);
-#endif
 
+#ifndef VIMAGE
 	/* XXX: destroying lo0 will lead to panics. */
 	KASSERT(V_loif != ifp, ("%s: destroying lo0", __func__));
+#endif
 
 	bpfdetach(ifp);
 	if_detach(ifp);
@@ -194,8 +193,10 @@
 static int vnet_loif_idetach(unused)
 	const void *unused;
 {
+	INIT_VNET_NET(curvnet);
 
-	/* XXX nothing done here - revisit! */
+	if_clone_detach(V_lo_cloner);
+	V_loif = NULL;
 
 	return (0);
 }



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