diff options
author | Ed Maste <emaste@FreeBSD.org> | 2018-05-21 11:56:07 +0000 |
---|---|---|
committer | Ed Maste <emaste@FreeBSD.org> | 2018-05-21 11:56:07 +0000 |
commit | 15f8acc53f5d936e0d5729db9894301e6db86353 (patch) | |
tree | a5d58cc8832042623108f2dd55418d091191634f /sys/netinet/in_mcast.c | |
parent | 6ffc72df9dfbe2c955064bc7246513f307863218 (diff) | |
download | src-test2-15f8acc53f5d936e0d5729db9894301e6db86353.tar.gz src-test2-15f8acc53f5d936e0d5729db9894301e6db86353.zip |
Notes
Diffstat (limited to 'sys/netinet/in_mcast.c')
-rw-r--r-- | sys/netinet/in_mcast.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/sys/netinet/in_mcast.c b/sys/netinet/in_mcast.c index 391f4907da4c..a37f64f1a89d 100644 --- a/sys/netinet/in_mcast.c +++ b/sys/netinet/in_mcast.c @@ -653,7 +653,6 @@ inm_release(struct in_multi *inm) { struct ifmultiaddr *ifma; struct ifnet *ifp; - struct vnet *saved_vnet; CTR2(KTR_IGMPV3, "%s: refcount is %d", __func__, inm->inm_refcount); MPASS(inm->inm_refcount == 0); @@ -664,16 +663,14 @@ inm_release(struct in_multi *inm) /* XXX this access is not covered by IF_ADDR_LOCK */ CTR2(KTR_IGMPV3, "%s: purging ifma %p", __func__, ifma); - if (ifp) { - saved_vnet = curvnet; - curvnet = ifp->if_vnet; - } + if (ifp) + CURVNET_SET(ifp->if_vnet); inm_purge(inm); free(inm, M_IPMADDR); if_delmulti_ifma_flags(ifma, 1); if (ifp) { - curvnet = saved_vnet; + CURVNET_RESTORE(); if_rele(ifp); } } @@ -1669,7 +1666,6 @@ inp_gcmoptions(epoch_context_t ctx) struct in_mfilter *imf; struct in_multi *inm; struct ifnet *ifp; - struct vnet *saved_vnet; size_t idx, nmships; imo = __containerof(ctx, struct ip_moptions, imo_epoch_ctx); @@ -1681,13 +1677,11 @@ inp_gcmoptions(epoch_context_t ctx) imf_leave(imf); inm = imo->imo_membership[idx]; ifp = inm->inm_ifp; - if (ifp) { - saved_vnet = curvnet; - curvnet = ifp->if_vnet; - } + if (ifp) + CURVNET_SET(ifp->if_vnet); (void)in_leavegroup(inm, imf); if (ifp) - curvnet = saved_vnet; + CURVNET_RESTORE(); if (imf) imf_purge(imf); } |