From owner-svn-src-all@FreeBSD.ORG Fri Jan 16 10:49:28 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45A8EC7E; Fri, 16 Jan 2015 10:49:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32467D7E; Fri, 16 Jan 2015 10:49:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0GAnSAF086866; Fri, 16 Jan 2015 10:49:28 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0GAnSfB086865; Fri, 16 Jan 2015 10:49:28 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201501161049.t0GAnSfB086865@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Fri, 16 Jan 2015 10:49:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277240 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2015 10:49:28 -0000 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); } /*