svn commit: r353424 - head/sys/net

Gleb Smirnoff glebius at FreeBSD.org
Thu Oct 10 23:50:33 UTC 2019


Author: glebius
Date: Thu Oct 10 23:50:32 2019
New Revision: 353424
URL: https://svnweb.freebsd.org/changeset/base/353424

Log:
  Interface output method must be executed in network epoch, so if_addr_rlock()
  isn't needed here.

Modified:
  head/sys/net/if_stf.c

Modified: head/sys/net/if_stf.c
==============================================================================
--- head/sys/net/if_stf.c	Thu Oct 10 23:49:19 2019	(r353423)
+++ head/sys/net/if_stf.c	Thu Oct 10 23:50:32 2019	(r353424)
@@ -374,7 +374,8 @@ stf_getsrcifa6(struct ifnet *ifp, struct in6_addr *add
 	struct sockaddr_in6 *sin6;
 	struct in_addr in;
 
-	if_addr_rlock(ifp);
+	NET_EPOCH_ASSERT();
+
 	CK_STAILQ_FOREACH(ia, &ifp->if_addrhead, ifa_link) {
 		if (ia->ifa_addr->sa_family != AF_INET6)
 			continue;
@@ -395,10 +396,8 @@ stf_getsrcifa6(struct ifnet *ifp, struct in6_addr *add
 
 		*addr = sin6->sin6_addr;
 		*mask = ia6->ia_prefixmask.sin6_addr;
-		if_addr_runlock(ifp);
 		return (0);
 	}
-	if_addr_runlock(ifp);
 
 	return (ENOENT);
 }


More information about the svn-src-head mailing list