Lock the interface address list while building replies to

NGM_CISCO_COOKIE messages in ng_iface.

MFC after:	2 weeks
This commit is contained in:
Robert Watson 2009-04-19 22:05:39 +00:00
parent 315a0b84cc
commit 3fd5c685f7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=191284

View File

@ -668,6 +668,7 @@ ng_iface_rcvmsg(node_p node, item_p item, hook_p lasthook)
struct ifaddr *ifa;
/* Return the first configured IP address */
IF_ADDR_LOCK(ifp);
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
struct ng_cisco_ipaddr *ips;
@ -685,6 +686,7 @@ ng_iface_rcvmsg(node_p node, item_p item, hook_p lasthook)
ifa->ifa_netmask)->sin_addr;
break;
}
IF_ADDR_UNLOCK(ifp);
/* No IP addresses on this interface? */
if (ifa == NULL)