aboutsummaryrefslogtreecommitdiff
path: root/sys/netgraph/ng_eiface.c
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2009-04-19 22:04:29 +0000
committerRobert Watson <rwatson@FreeBSD.org>2009-04-19 22:04:29 +0000
commit315a0b84cc08ece7d6825bb30eb2e4a294b2f41f (patch)
tree2da099366411108238c032d23459b79f5a2ea664 /sys/netgraph/ng_eiface.c
parentf25cc1d0d9d6ec1846fb9354146e2ae0a7da27fd (diff)
Lock interface address list when building a reply to NGM_EIFACE_GET_IFADDRS
messages in ng_eiface. MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=191283
Diffstat (limited to 'sys/netgraph/ng_eiface.c')
-rw-r--r--sys/netgraph/ng_eiface.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/netgraph/ng_eiface.c b/sys/netgraph/ng_eiface.c
index 542eaadb7a11..eb638fe7e059 100644
--- a/sys/netgraph/ng_eiface.c
+++ b/sys/netgraph/ng_eiface.c
@@ -452,10 +452,12 @@ ng_eiface_rcvmsg(node_p node, item_p item, hook_p lasthook)
/* Determine size of response and allocate it */
buflen = 0;
+ IF_ADDR_LOCK(ifp);
TAILQ_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_UNLOCK(ifp);
error = ENOMEM;
break;
}
@@ -474,6 +476,7 @@ ng_eiface_rcvmsg(node_p node, item_p item, hook_p lasthook)
ptr += len;
buflen -= len;
}
+ IF_ADDR_UNLOCK(ifp);
break;
}