Author: glebius
Date: Wed Oct  9 17:03:20 2019
New Revision: 353357
URL: https://svnweb.freebsd.org/changeset/base/353357

Log:
  Revert most of the multicast changes from r353292. This needs a more
  accurate approach.

Modified:
  head/sys/netinet/in_mcast.c
  head/sys/netinet/ip_output.c

Modified: head/sys/netinet/in_mcast.c
==============================================================================
--- head/sys/netinet/in_mcast.c Wed Oct  9 17:02:28 2019        (r353356)
+++ head/sys/netinet/in_mcast.c Wed Oct  9 17:03:20 2019        (r353357)
@@ -388,12 +388,14 @@ inm_lookup_locked(struct ifnet *ifp, const struct in_a
 struct in_multi *
 inm_lookup(struct ifnet *ifp, const struct in_addr ina)
 {
+       struct epoch_tracker et;
        struct in_multi *inm;
 
        IN_MULTI_LIST_LOCK_ASSERT();
-       NET_EPOCH_ASSERT();
+       NET_EPOCH_ENTER(et);
 
        inm = inm_lookup_locked(ifp, ina);
+       NET_EPOCH_EXIT(et);
 
        return (inm);
 }
@@ -1198,13 +1200,10 @@ int
 in_joingroup(struct ifnet *ifp, const struct in_addr *gina,
     /*const*/ struct in_mfilter *imf, struct in_multi **pinm)
 {
-       struct epoch_tracker et;
        int error;
 
        IN_MULTI_LOCK();
-       NET_EPOCH_ENTER(et);
        error = in_joingroup_locked(ifp, gina, imf, pinm);
-       NET_EPOCH_EXIT(et);
        IN_MULTI_UNLOCK();
 
        return (error);
@@ -1227,7 +1226,6 @@ in_joingroup_locked(struct ifnet *ifp, const struct in
        struct in_multi         *inm;
        int                      error;
 
-       NET_EPOCH_ASSERT();
        IN_MULTI_LOCK_ASSERT();
        IN_MULTI_LIST_UNLOCK_ASSERT();
 
@@ -1285,14 +1283,11 @@ in_joingroup_locked(struct ifnet *ifp, const struct in
 int
 in_leavegroup(struct in_multi *inm, /*const*/ struct in_mfilter *imf)
 {
-       struct epoch_tracker et;
        int error;
 
-       NET_EPOCH_ENTER(et);
        IN_MULTI_LOCK();
        error = in_leavegroup_locked(inm, imf);
        IN_MULTI_UNLOCK();
-       NET_EPOCH_EXIT(et);
 
        return (error);
 }
@@ -1316,7 +1311,6 @@ in_leavegroup_locked(struct in_multi *inm, /*const*/ s
        struct in_mfilter        timf;
        int                      error;
 
-       NET_EPOCH_ASSERT();
        IN_MULTI_LOCK_ASSERT();
        IN_MULTI_LIST_UNLOCK_ASSERT();
 
@@ -1818,11 +1812,15 @@ inp_getmoptions(struct inpcb *inp, struct sockopt *sop
                        if (!in_nullhost(imo->imo_multicast_addr)) {
                                mreqn.imr_address = imo->imo_multicast_addr;
                        } else if (ifp != NULL) {
+                               struct epoch_tracker et;
+
                                mreqn.imr_ifindex = ifp->if_index;
+                               NET_EPOCH_ENTER(et);
                                IFP_TO_IA(ifp, ia, &in_ifa_tracker);
                                if (ia != NULL)
                                        mreqn.imr_address =
                                            IA_SIN(ia)->sin_addr;
+                               NET_EPOCH_EXIT(et);
                        }
                }
                INP_WUNLOCK(inp);

Modified: head/sys/netinet/ip_output.c
==============================================================================
--- head/sys/netinet/ip_output.c        Wed Oct  9 17:02:28 2019        
(r353356)
+++ head/sys/netinet/ip_output.c        Wed Oct  9 17:03:20 2019        
(r353357)
@@ -1079,7 +1079,6 @@ int
 ip_ctloutput(struct socket *so, struct sockopt *sopt)
 {
        struct inpcb *inp = sotoinpcb(so);
-       struct epoch_tracker et;
        int     error, optval;
 #ifdef RSS
        uint32_t rss_bucket;
@@ -1518,9 +1517,7 @@ ip_ctloutput(struct socket *so, struct sockopt *sopt)
                case IP_MULTICAST_TTL:
                case IP_MULTICAST_LOOP:
                case IP_MSFILTER:
-                       NET_EPOCH_ENTER(et);
                        error = inp_getmoptions(inp, sopt);
-                       NET_EPOCH_EXIT(et);
                        break;
 
 #if defined(IPSEC) || defined(IPSEC_SUPPORT)
_______________________________________________
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