Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Oct 2019 23:47:14 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r353421 - head/sys/netgraph
Message-ID:  <201910102347.x9ANlESP084314@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201910102347.x9ANlESP084314>