From 80e4437a3b63e37efc7987db0e7f044546e89418 Mon Sep 17 00:00:00 2001 From: rwatson Date: Sun, 19 Apr 2009 22:05:39 +0000 Subject: Lock the interface address list while building replies to NGM_CISCO_COOKIE messages in ng_iface. MFC after: 2 weeks --- sys/netgraph/ng_iface.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sys/netgraph') diff --git a/sys/netgraph/ng_iface.c b/sys/netgraph/ng_iface.c index 99fd971..6ee5e89 100644 --- a/sys/netgraph/ng_iface.c +++ b/sys/netgraph/ng_iface.c @@ -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) -- cgit v1.1