Revert r333968, it broke all archs but i386 and amd64

This commit is contained in:
emaste 2018-05-21 11:56:07 +00:00
parent 7ff9451fb2
commit 326c8de9ed
2 changed files with 12 additions and 24 deletions

View File

@ -653,7 +653,6 @@ inm_release(struct in_multi *inm)
{ {
struct ifmultiaddr *ifma; struct ifmultiaddr *ifma;
struct ifnet *ifp; struct ifnet *ifp;
struct vnet *saved_vnet;
CTR2(KTR_IGMPV3, "%s: refcount is %d", __func__, inm->inm_refcount); CTR2(KTR_IGMPV3, "%s: refcount is %d", __func__, inm->inm_refcount);
MPASS(inm->inm_refcount == 0); 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 */ /* XXX this access is not covered by IF_ADDR_LOCK */
CTR2(KTR_IGMPV3, "%s: purging ifma %p", __func__, ifma); CTR2(KTR_IGMPV3, "%s: purging ifma %p", __func__, ifma);
if (ifp) { if (ifp)
saved_vnet = curvnet; CURVNET_SET(ifp->if_vnet);
curvnet = ifp->if_vnet;
}
inm_purge(inm); inm_purge(inm);
free(inm, M_IPMADDR); free(inm, M_IPMADDR);
if_delmulti_ifma_flags(ifma, 1); if_delmulti_ifma_flags(ifma, 1);
if (ifp) { if (ifp) {
curvnet = saved_vnet; CURVNET_RESTORE();
if_rele(ifp); if_rele(ifp);
} }
} }
@ -1669,7 +1666,6 @@ inp_gcmoptions(epoch_context_t ctx)
struct in_mfilter *imf; struct in_mfilter *imf;
struct in_multi *inm; struct in_multi *inm;
struct ifnet *ifp; struct ifnet *ifp;
struct vnet *saved_vnet;
size_t idx, nmships; size_t idx, nmships;
imo = __containerof(ctx, struct ip_moptions, imo_epoch_ctx); imo = __containerof(ctx, struct ip_moptions, imo_epoch_ctx);
@ -1681,13 +1677,11 @@ inp_gcmoptions(epoch_context_t ctx)
imf_leave(imf); imf_leave(imf);
inm = imo->imo_membership[idx]; inm = imo->imo_membership[idx];
ifp = inm->inm_ifp; ifp = inm->inm_ifp;
if (ifp) { if (ifp)
saved_vnet = curvnet; CURVNET_SET(ifp->if_vnet);
curvnet = ifp->if_vnet;
}
(void)in_leavegroup(inm, imf); (void)in_leavegroup(inm, imf);
if (ifp) if (ifp)
curvnet = saved_vnet; CURVNET_RESTORE();
if (imf) if (imf)
imf_purge(imf); imf_purge(imf);
} }

View File

@ -524,7 +524,6 @@ in6m_release(struct in6_multi *inm)
{ {
struct ifmultiaddr *ifma; struct ifmultiaddr *ifma;
struct ifnet *ifp; struct ifnet *ifp;
struct vnet *saved_vnet;
CTR2(KTR_MLD, "%s: refcount is %d", __func__, inm->in6m_refcount); CTR2(KTR_MLD, "%s: refcount is %d", __func__, inm->in6m_refcount);
@ -540,16 +539,14 @@ in6m_release(struct in6_multi *inm)
KASSERT(ifma->ifma_protospec == NULL, KASSERT(ifma->ifma_protospec == NULL,
("%s: ifma_protospec != NULL", __func__)); ("%s: ifma_protospec != NULL", __func__));
if (ifp) { if (ifp)
saved_vnet = curvnet; CURVNET_SET(ifp->if_vnet);
curvnet = ifp->if_vnet;
}
in6m_purge(inm); in6m_purge(inm);
free(inm, M_IP6MADDR); free(inm, M_IP6MADDR);
if_delmulti_ifma_flags(ifma, 1); if_delmulti_ifma_flags(ifma, 1);
if (ifp) { if (ifp) {
curvnet = saved_vnet; CURVNET_RESTORE();
if_rele(ifp); if_rele(ifp);
} }
} }
@ -1631,7 +1628,6 @@ inp_gcmoptions(epoch_context_t ctx)
struct in6_mfilter *imf; struct in6_mfilter *imf;
struct in6_multi *inm; struct in6_multi *inm;
struct ifnet *ifp; struct ifnet *ifp;
struct vnet *saved_vnet;
size_t idx, nmships; size_t idx, nmships;
imo = __containerof(ctx, struct ip6_moptions, imo6_epoch_ctx); imo = __containerof(ctx, struct ip6_moptions, imo6_epoch_ctx);
@ -1643,13 +1639,11 @@ inp_gcmoptions(epoch_context_t ctx)
im6f_leave(imf); im6f_leave(imf);
inm = imo->im6o_membership[idx]; inm = imo->im6o_membership[idx];
ifp = inm->in6m_ifp; ifp = inm->in6m_ifp;
if (ifp) { if (ifp)
saved_vnet = curvnet; CURVNET_SET(ifp->if_vnet);
curvnet = ifp->if_vnet;
}
(void)in6_leavegroup(inm, imf); (void)in6_leavegroup(inm, imf);
if (ifp) if (ifp)
curvnet = saved_vnet; CURVNET_RESTORE();
if (imf) if (imf)
im6f_purge(imf); im6f_purge(imf);
} }