From owner-svn-src-head@FreeBSD.ORG Thu Jun 25 14:44:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 047DD1065689; Thu, 25 Jun 2009 14:44:01 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E0DC18FC12; Thu, 25 Jun 2009 14:44:00 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5PEi0OB054383; Thu, 25 Jun 2009 14:44:00 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5PEi0F5054380; Thu, 25 Jun 2009 14:44:00 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906251444.n5PEi0F5054380@svn.freebsd.org> From: Robert Watson Date: Thu, 25 Jun 2009 14:44:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194962 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jun 2009 14:44:03 -0000 Author: rwatson Date: Thu Jun 25 14:44:00 2009 New Revision: 194962 URL: http://svn.freebsd.org/changeset/base/194962 Log: Initialize in_ifaddr_lock using RW_SYSINIT() instead of in ip_init(), so that it doesn't run multiple times if VIMAGE is being used. Discussed with: bz MFC after: 6 weeks Modified: head/sys/netinet/in_var.h head/sys/netinet/ip_input.c Modified: head/sys/netinet/in_var.h ============================================================================== --- head/sys/netinet/in_var.h Thu Jun 25 14:41:42 2009 (r194961) +++ head/sys/netinet/in_var.h Thu Jun 25 14:44:00 2009 (r194962) @@ -116,7 +116,6 @@ extern u_long in_ifaddrhmask; /* mask extern struct rwlock in_ifaddr_lock; -#define IN_IFADDR_LOCK_INIT() rw_init(&in_ifaddr_lock, "in_ifaddr_lock") #define IN_IFADDR_LOCK_ASSERT() rw_assert(&in_ifaddr_lock, RA_LOCKED) #define IN_IFADDR_RLOCK() rw_rlock(&in_ifaddr_lock) #define IN_IFADDR_RLOCK_ASSERT() rw_assert(&in_ifaddr_lock, RA_RLOCKED) Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Thu Jun 25 14:41:42 2009 (r194961) +++ head/sys/netinet/ip_input.c Thu Jun 25 14:44:00 2009 (r194962) @@ -117,7 +117,9 @@ static int maxfragsperpacket; int ipstealth; static int nipq; /* Total # of reass queues */ #endif + struct rwlock in_ifaddr_lock; +RW_SYSINIT(in_ifaddr_lock, &in_ifaddr_lock, "in_ifaddr_lock"); SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip, IPCTL_FORWARDING, forwarding, CTLFLAG_RW, ipforwarding, 0, @@ -326,7 +328,6 @@ ip_init(void) TAILQ_INIT(&V_in_ifaddrhead); V_in_ifaddrhashtbl = hashinit(INADDR_NHASH, M_IFADDR, &V_in_ifaddrhmask); - IN_IFADDR_LOCK_INIT(); /* Initialize IP reassembly queue. */ for (i = 0; i < IPREASS_NHASH; i++)