Author: glebius
Date: Tue Oct 22 16:06:33 2019
New Revision: 353889
URL: https://svnweb.freebsd.org/changeset/base/353889

Log:
  Execute nd6_dad_timer() in the network epoch, since nd6_dad_duplicated()
  requires it.
  Make nd6_dad_starttimer() require network epoch.  Two calls out of three
  happen from nd6_dad_timer().  Enter epoch in the remaining one.

Modified:
  head/sys/netinet6/nd6_nbr.c

Modified: head/sys/netinet6/nd6_nbr.c
==============================================================================
--- head/sys/netinet6/nd6_nbr.c Tue Oct 22 15:59:16 2019        (r353888)
+++ head/sys/netinet6/nd6_nbr.c Tue Oct 22 16:06:33 2019        (r353889)
@@ -1192,13 +1192,10 @@ static void
 nd6_dad_starttimer(struct dadq *dp, int ticks, int send_ns)
 {
 
-       if (send_ns != 0) {
-               struct epoch_tracker et;
+       NET_EPOCH_ASSERT();
 
-               NET_EPOCH_ENTER(et);
+       if (send_ns != 0)
                nd6_dad_ns_output(dp);
-               NET_EPOCH_EXIT(et);
-       }
        callout_reset(&dp->dad_timer_ch, ticks,
            (void (*)(void *))nd6_dad_timer, (void *)dp);
 }
@@ -1237,6 +1234,7 @@ nd6_dad_start(struct ifaddr *ifa, int delay)
        struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa;
        struct dadq *dp;
        char ip6buf[INET6_ADDRSTRLEN];
+       struct epoch_tracker et;
 
        KASSERT((ia->ia6_flags & IN6_IFF_TENTATIVE) != 0,
            ("starting DAD on non-tentative address %p", ifa));
@@ -1298,7 +1296,9 @@ nd6_dad_start(struct ifaddr *ifa, int delay)
        /* Add this to the dadq and add a reference for the dadq. */
        refcount_init(&dp->dad_refcnt, 1);
        nd6_dad_add(dp);
+       NET_EPOCH_ENTER(et);
        nd6_dad_starttimer(dp, delay, 0);
+       NET_EPOCH_EXIT(et);
 }
 
 /*
@@ -1330,9 +1330,11 @@ nd6_dad_timer(struct dadq *dp)
        struct ifnet *ifp = dp->dad_ifa->ifa_ifp;
        struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa;
        char ip6buf[INET6_ADDRSTRLEN];
+       struct epoch_tracker et;
 
        KASSERT(ia != NULL, ("DAD entry %p with no address", dp));
 
+       NET_EPOCH_ENTER(et);
        if (ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) {
                /* Do not need DAD for ifdisabled interface. */
                log(LOG_ERR, "nd6_dad_timer: cancel DAD on %s because of "
@@ -1429,6 +1431,7 @@ nd6_dad_timer(struct dadq *dp)
 err:
        nd6_dad_del(dp);
 done:
+       NET_EPOCH_EXIT(et);
        CURVNET_RESTORE();
 }
 
_______________________________________________
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