PERFORCE change 163487 for review
Marko Zec
zec at FreeBSD.org
Thu Jun 4 14:04:29 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=163487
Change 163487 by zec at 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);
}
More information about the p4-projects
mailing list