Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Oct 2019 23:49:19 +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: r353423 - head/sys/netgraph
Message-ID:  <201910102349.x9ANnJ3r084504@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Thu Oct 10 23:49:19 2019
New Revision: 353423
URL: https://svnweb.freebsd.org/changeset/base/353423

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

Modified:
  head/sys/netgraph/ng_eiface.c

Modified: head/sys/netgraph/ng_eiface.c
==============================================================================
--- head/sys/netgraph/ng_eiface.c	Thu Oct 10 23:48:42 2019	(r353422)
+++ head/sys/netgraph/ng_eiface.c	Thu Oct 10 23:49:19 2019	(r353423)
@@ -506,18 +506,19 @@ ng_eiface_rcvmsg(node_p node, item_p item, hook_p last
 
 		case NGM_EIFACE_GET_IFADDRS:
 		    {
+			struct epoch_tracker et;
 			struct ifaddr *ifa;
 			caddr_t ptr;
 			int buflen;
 
 			/* Determine size of response and allocate it */
 			buflen = 0;
-			if_addr_rlock(ifp);
+			NET_EPOCH_ENTER(et);
 			CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
 				buflen += SA_SIZE(ifa->ifa_addr);
 			NG_MKRESPONSE(resp, msg, buflen, M_NOWAIT);
 			if (resp == NULL) {
-				if_addr_runlock(ifp);
+				NET_EPOCH_EXIT(et);
 				error = ENOMEM;
 				break;
 			}
@@ -536,7 +537,7 @@ ng_eiface_rcvmsg(node_p node, item_p item, hook_p last
 				ptr += len;
 				buflen -= len;
 			}
-			if_addr_runlock(ifp);
+			NET_EPOCH_EXIT(et);
 			break;
 		    }
 



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