Author: emaste
Date: Mon May 21 11:56:07 2018
New Revision: 333975
URL: https://svnweb.freebsd.org/changeset/base/333975

Log:
  Revert r333968, it broke all archs but i386 and amd64

Modified:
  head/sys/netinet/in_mcast.c
  head/sys/netinet6/in6_mcast.c

Modified: head/sys/netinet/in_mcast.c
==============================================================================
--- head/sys/netinet/in_mcast.c Mon May 21 09:43:50 2018        (r333974)
+++ head/sys/netinet/in_mcast.c Mon May 21 11:56:07 2018        (r333975)
@@ -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);
        }

Modified: head/sys/netinet6/in6_mcast.c
==============================================================================
--- head/sys/netinet6/in6_mcast.c       Mon May 21 09:43:50 2018        
(r333974)
+++ head/sys/netinet6/in6_mcast.c       Mon May 21 11:56:07 2018        
(r333975)
@@ -524,7 +524,6 @@ in6m_release(struct in6_multi *inm)
 {
        struct ifmultiaddr *ifma;
        struct ifnet *ifp;
-       struct vnet *saved_vnet;
 
        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,
            ("%s: ifma_protospec != NULL", __func__));
 
-       if (ifp) {
-               saved_vnet = curvnet;
-               curvnet = ifp->if_vnet;
-       }
+       if (ifp)
+               CURVNET_SET(ifp->if_vnet);
        in6m_purge(inm);
        free(inm, M_IP6MADDR);
 
        if_delmulti_ifma_flags(ifma, 1);
        if (ifp) {
-               curvnet = saved_vnet;
+               CURVNET_RESTORE();
                if_rele(ifp);
        }
 }
@@ -1631,7 +1628,6 @@ inp_gcmoptions(epoch_context_t ctx)
        struct in6_mfilter      *imf;
        struct in6_multi *inm;
        struct ifnet *ifp;
-       struct vnet *saved_vnet;
        size_t                   idx, nmships;
 
        imo =  __containerof(ctx, struct ip6_moptions, imo6_epoch_ctx);
@@ -1643,13 +1639,11 @@ inp_gcmoptions(epoch_context_t ctx)
                        im6f_leave(imf);
                inm = imo->im6o_membership[idx];
                ifp = inm->in6m_ifp;
-               if (ifp) {
-                       saved_vnet = curvnet;
-                       curvnet = ifp->if_vnet;
-               }                       
+               if (ifp)
+                       CURVNET_SET(ifp->if_vnet);
                (void)in6_leavegroup(inm, imf);
                if (ifp)
-                       curvnet = saved_vnet;
+                       CURVNET_RESTORE();
                if (imf)
                        im6f_purge(imf);
        }
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to