svn commit: r271916 - head/sys/net
Hiroki Sato
hrs at FreeBSD.org
Sun Sep 21 03:48:21 UTC 2014
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 <sys/counter.h>
+#include <net/vnet.h>
/*
* 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,
More information about the svn-src-head
mailing list