summaryrefslogtreecommitdiffstats
path: root/sys/net/if_loop.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net/if_loop.c')
-rw-r--r--sys/net/if_loop.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c
index f1a017b..5748311 100644
--- a/sys/net/if_loop.c
+++ b/sys/net/if_loop.c
@@ -105,6 +105,7 @@ int looutput(struct ifnet *ifp, struct mbuf *m,
struct sockaddr *dst, struct rtentry *rt);
static int lo_clone_create(struct if_clone *, int, caddr_t);
static void lo_clone_destroy(struct ifnet *);
+static int vnet_loif_iattach(const void *);
#ifdef VIMAGE_GLOBALS
struct ifnet *loif; /* Used externally */
@@ -153,6 +154,15 @@ lo_clone_create(struct if_clone *ifc, int unit, caddr_t params)
return (0);
}
+static int vnet_loif_iattach(const void *unused __unused)
+{
+ INIT_VNET_NET(curvnet);
+
+ V_loif = NULL;
+ if_clone_attach(&lo_cloner);
+ return (0);
+}
+
static int
loop_modevent(module_t mod, int type, void *data)
{
@@ -160,8 +170,7 @@ loop_modevent(module_t mod, int type, void *data)
switch (type) {
case MOD_LOAD:
- V_loif = NULL;
- if_clone_attach(&lo_cloner);
+ vnet_loif_iattach(NULL);
break;
case MOD_UNLOAD:
OpenPOWER on IntegriCloud