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++) _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"