From owner-svn-src-head@FreeBSD.ORG Sun Sep 21 03:48:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 396A73FE; Sun, 21 Sep 2014 03:48:21 +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 0C8E8FF3; Sun, 21 Sep 2014 03:48:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8L3mKRK012479; Sun, 21 Sep 2014 03:48:20 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8L3mKfS012477; Sun, 21 Sep 2014 03:48:20 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201409210348.s8L3mKfS012477@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Sun, 21 Sep 2014 03:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271916 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 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: Sun, 21 Sep 2014 03:48:21 -0000 Author: hrs Date: Sun Sep 21 03:48:20 2014 New Revision: 271916 URL: http://svnweb.freebsd.org/changeset/base/271916 Log: Make net.add_addr_allfibs vnet-local. Modified: head/sys/net/route.c head/sys/net/route.h Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sun Sep 21 03:00:30 2014 (r271915) +++ head/sys/net/route.c Sun Sep 21 03:48:20 2014 (r271916) @@ -108,9 +108,9 @@ SYSCTL_UINT(_net, OID_AUTO, fibs, CTLFLA * always work given the fib can be overridden and prefixes can be added * from the network stack context. */ -u_int rt_add_addr_allfibs = 1; -SYSCTL_UINT(_net, OID_AUTO, add_addr_allfibs, CTLFLAG_RWTUN, - &rt_add_addr_allfibs, 0, ""); +VNET_DEFINE(u_int, rt_add_addr_allfibs) = 1; +SYSCTL_UINT(_net, OID_AUTO, add_addr_allfibs, CTLFLAG_RWTUN | CTLFLAG_VNET, + &VNET_NAME(rt_add_addr_allfibs), 0, ""); VNET_DEFINE(struct rtstat, rtstat); #define V_rtstat VNET(rtstat) @@ -1613,9 +1613,9 @@ rtinit1(struct ifaddr *ifa, int cmd, int break; } if (fibnum == RT_ALL_FIBS) { - if (rt_add_addr_allfibs == 0 && cmd == (int)RTM_ADD) { + if (V_rt_add_addr_allfibs == 0 && cmd == (int)RTM_ADD) startfib = endfib = ifa->ifa_ifp->if_fib; - } else { + else { startfib = 0; endfib = rt_numfibs - 1; } Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Sun Sep 21 03:00:30 2014 (r271915) +++ head/sys/net/route.h Sun Sep 21 03:48:20 2014 (r271916) @@ -34,6 +34,7 @@ #define _NET_ROUTE_H_ #include +#include /* * Kernel resident routing tables. @@ -85,7 +86,8 @@ struct rt_metrics { #define RT_DEFAULT_FIB 0 /* Explicitly mark fib=0 restricted cases */ #define RT_ALL_FIBS -1 /* Announce event for every fib */ extern u_int rt_numfibs; /* number of usable routing tables */ -extern u_int rt_add_addr_allfibs; /* Announce interfaces to all fibs */ +VNET_DECLARE(u_int, rt_add_addr_allfibs); /* Announce interfaces to all fibs */ +#define V_rt_add_addr_allfibs VNET(rt_add_addr_allfibs) /* * We distinguish between routes to hosts and routes to networks,