From ebded7d547331722f7064a94a92ef0d9f5fbec7a Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Thu, 10 Oct 2019 23:49:19 +0000 Subject: [PATCH] Don't use if_maddr_rlock() in ng_eiface(4), use epoch(9) directly instead. --- sys/netgraph/ng_eiface.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/netgraph/ng_eiface.c b/sys/netgraph/ng_eiface.c index ab251a5686f5..3fd772b843ba 100644 --- a/sys/netgraph/ng_eiface.c +++ b/sys/netgraph/ng_eiface.c @@ -506,18 +506,19 @@ ng_eiface_rcvmsg(node_p node, item_p item, hook_p lasthook) 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 lasthook) ptr += len; buflen -= len; } - if_addr_runlock(ifp); + NET_EPOCH_EXIT(et); break; }