diff options
author | Bjoern A. Zeeb <bz@FreeBSD.org> | 2016-05-18 20:06:45 +0000 |
---|---|---|
committer | Bjoern A. Zeeb <bz@FreeBSD.org> | 2016-05-18 20:06:45 +0000 |
commit | ad4e911678c60af0f31f04f6a9675aa96287d9cc (patch) | |
tree | 2e1ce39581481bd3c8572a45803b7e8f892fbf8a | |
parent | 44444759e55ced33e066e5caa7739dfa09baa037 (diff) |
Notes
-rw-r--r-- | sys/net/if.c | 17 | ||||
-rw-r--r-- | sys/net/if_var.h | 1 | ||||
-rw-r--r-- | sys/net/vnet.c | 8 |
3 files changed, 17 insertions, 9 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 063da496a2f4..33eb239a50de 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -182,6 +182,9 @@ static int if_getgroupmembers(struct ifgroupreq *); static void if_delgroups(struct ifnet *); static void if_attach_internal(struct ifnet *, int, struct if_clone *); static int if_detach_internal(struct ifnet *, int, struct if_clone **); +#ifdef VIMAGE +static void if_vmove(struct ifnet *, struct vnet *); +#endif #ifdef INET6 /* @@ -392,6 +395,20 @@ vnet_if_uninit(const void *unused __unused) } VNET_SYSUNINIT(vnet_if_uninit, SI_SUB_INIT_IF, SI_ORDER_FIRST, vnet_if_uninit, NULL); + +static void +vnet_if_return(const void *unused __unused) +{ + struct ifnet *ifp, *nifp; + + /* Return all inherited interfaces to their parent vnets. */ + TAILQ_FOREACH_SAFE(ifp, &V_ifnet, if_link, nifp) { + if (ifp->if_home_vnet != ifp->if_vnet) + if_vmove(ifp, ifp->if_home_vnet); + } +} +VNET_SYSUNINIT(vnet_if_return, SI_SUB_VNET_DONE, SI_ORDER_ANY, + vnet_if_return, NULL); #endif static void diff --git a/sys/net/if_var.h b/sys/net/if_var.h index ae7a13037fcf..f0766ee70721 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -535,7 +535,6 @@ void if_dead(struct ifnet *); int if_delmulti(struct ifnet *, struct sockaddr *); void if_delmulti_ifma(struct ifmultiaddr *); void if_detach(struct ifnet *); -void if_vmove(struct ifnet *, struct vnet *); void if_purgeaddrs(struct ifnet *); void if_delallmulti(struct ifnet *); void if_down(struct ifnet *); diff --git a/sys/net/vnet.c b/sys/net/vnet.c index 0eb9935549da..afb836aa14a6 100644 --- a/sys/net/vnet.c +++ b/sys/net/vnet.c @@ -269,7 +269,6 @@ vnet_alloc(void) void vnet_destroy(struct vnet *vnet) { - struct ifnet *ifp, *nifp; SDT_PROBE2(vnet, functions, vnet_destroy, entry, __LINE__, vnet); KASSERT(vnet->vnet_sockcnt == 0, @@ -280,13 +279,6 @@ vnet_destroy(struct vnet *vnet) VNET_LIST_WUNLOCK(); CURVNET_SET_QUIET(vnet); - - /* Return all inherited interfaces to their parent vnets. */ - TAILQ_FOREACH_SAFE(ifp, &V_ifnet, if_link, nifp) { - if (ifp->if_home_vnet != ifp->if_vnet) - if_vmove(ifp, ifp->if_home_vnet); - } - vnet_sysuninit(); CURVNET_RESTORE(); |