svn commit: r353421 - head/sys/netgraph

Gleb Smirnoff glebius at FreeBSD.org
Thu Oct 10 23:47:15 UTC 2019


Author: glebius
Date: Thu Oct 10 23:47:14 2019
New Revision: 353421
URL: https://svnweb.freebsd.org/changeset/base/353421

Log:
  Don't use if_maddr_rlock() in ng_ether(4), use epoch(9) directly instead.

Modified:
  head/sys/netgraph/ng_ether.c

Modified: head/sys/netgraph/ng_ether.c
==============================================================================
--- head/sys/netgraph/ng_ether.c	Thu Oct 10 23:44:56 2019	(r353420)
+++ head/sys/netgraph/ng_ether.c	Thu Oct 10 23:47:14 2019	(r353421)
@@ -578,6 +578,7 @@ ng_ether_rcvmsg(node_p node, item_p item, hook_p lasth
 		case NGM_ETHER_ADD_MULTI:
 		    {
 			struct sockaddr_dl sa_dl;
+			struct epoch_tracker et;
 			struct ifmultiaddr *ifma;
 
 			if (msg->header.arglen != ETHER_ADDR_LEN) {
@@ -597,10 +598,10 @@ ng_ether_rcvmsg(node_p node, item_p item, hook_p lasth
 			 * lose a race while we check if the membership
 			 * already exists.
 			 */
-			if_maddr_rlock(priv->ifp);
+			NET_EPOCH_ENTER(et);
 			ifma = if_findmulti(priv->ifp,
 			    (struct sockaddr *)&sa_dl);
-			if_maddr_runlock(priv->ifp);
+			NET_EPOCH_EXIT(et);
 			if (ifma != NULL) {
 				error = EADDRINUSE;
 			} else {


More information about the svn-src-head mailing list