PERFORCE change 118598 for review
Marko Zec
zec at FreeBSD.org
Sun Apr 22 19:34:34 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=118598
Change 118598 by zec at zec_tca51 on 2007/04/22 19:34:14
Implement vnet detachment routine for lo0.
Affected files ...
.. //depot/projects/vimage/src/sys/net/if_loop.c#10 edit
Differences ...
==== //depot/projects/vimage/src/sys/net/if_loop.c#10 (text+ko) ====
@@ -107,8 +107,10 @@
static int lo_clone_create(struct if_clone *, int, caddr_t);
static void lo_clone_destroy(struct ifnet *);
static int vnet_loif_iattach(void);
+#ifdef VIMAGE
+static int vnet_loif_idetach(void);
+#endif
-
#ifndef VIMAGE
struct ifnet *loif = NULL; /* Used externally */
static LIST_HEAD(lo_list, lo_softc) lo_list;
@@ -188,7 +190,7 @@
.name = "loif",
.symmap = NULL,
.i_attach = vnet_loif_iattach,
- .i_detach = NULL,
+ .i_detach = vnet_loif_idetach
};
#endif
@@ -208,6 +210,21 @@
return 0;
}
+#ifdef VIMAGE
+static int vnet_loif_idetach(void)
+{
+ INIT_VNET_NET(curvnet);
+ struct lo_softc *lop, *nlop;
+
+ LIST_FOREACH_SAFE(lop, &V_lo_list, sc_next, nlop) {
+ if (lop->sc_ifp == V_loif)
+ V_loif = NULL;
+ lo_clone_destroy(lop->sc_ifp);
+ }
+ return 0;
+}
+#endif
+
static int
loop_modevent(module_t mod, int type, void *data)
{
More information about the p4-projects
mailing list