Date: Fri, 16 Jan 2015 10:49:28 +0000 (UTC) From: "Alexander V. Chernikov" <melifaro@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277240 - head/sys/netpfil/ipfw Message-ID: <201501161049.t0GAnSfB086865@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: melifaro Date: Fri Jan 16 10:49:27 2015 New Revision: 277240 URL: https://svnweb.freebsd.org/changeset/base/277240 Log: Use ipfw runtime lock only when real modification is required. Modified: head/sys/netpfil/ipfw/ip_fw_nat.c Modified: head/sys/netpfil/ipfw/ip_fw_nat.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_nat.c Fri Jan 16 10:44:39 2015 (r277239) +++ head/sys/netpfil/ipfw/ip_fw_nat.c Fri Jan 16 10:49:27 2015 (r277240) @@ -105,7 +105,7 @@ ifaddr_change(void *arg __unused, struct KASSERT(curvnet == ifp->if_vnet, ("curvnet(%p) differs from iface vnet(%p)", curvnet, ifp->if_vnet)); chain = &V_layer3_chain; - IPFW_WLOCK(chain); + IPFW_UH_WLOCK(chain); /* Check every nat entry... */ LIST_FOREACH(ptr, &chain->nat, _next) { /* ...using nic 'ifp->if_xname' as dynamic alias address. */ @@ -117,13 +117,15 @@ ifaddr_change(void *arg __unused, struct continue; if (ifa->ifa_addr->sa_family != AF_INET) continue; + IPFW_WLOCK(chain); ptr->ip = ((struct sockaddr_in *) (ifa->ifa_addr))->sin_addr; LibAliasSetAddress(ptr->lib, ptr->ip); + IPFW_WUNLOCK(chain); } if_addr_runlock(ifp); } - IPFW_WUNLOCK(chain); + IPFW_UH_WUNLOCK(chain); } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501161049.t0GAnSfB086865>