From 2d39824195933c173bbfc9b31773070202d2e30e Mon Sep 17 00:00:00 2001 From: "Alexander V. Chernikov" Date: Sun, 8 Nov 2020 18:27:49 +0000 Subject: [PATCH] Switch net.add_addr_allfibs default to 0. The goal of the fib support is to provide multiple independent routing tables, isolated from each other. net.add_addr_allfibs default tries to shift gears in the opposite direction, unconditionally inserting all addresses to all of the fibs. There are use cases when this is necessary, however this is not a default expected behaviour, especially compared to other implementations. Provide WARNING message for the setups with multiple fibs to notify potential users of the feature. Differential Revision: https://reviews.freebsd.org/D26076 --- UPDATING | 4 ++++ sys/net/route/route_ifaddrs.c | 2 +- sys/net/route/route_tables.c | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 635cbab47dc7..28460b14476b 100644 --- a/UPDATING +++ b/UPDATING @@ -26,6 +26,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20201108: + Default value of net.add_addr_allfibs has been changed to 0. + If you have multi-fib configuration and rely on existence of all + interface routes in every fib, you need to set the above sysctl to 1. 20201030: The internal pre-processor in the calendar(1) program has been extended to support more C pre-processor commands (e.g. #ifdef, #else, diff --git a/sys/net/route/route_ifaddrs.c b/sys/net/route/route_ifaddrs.c index 5d0dab75869d..69b35831a01d 100644 --- a/sys/net/route/route_ifaddrs.c +++ b/sys/net/route/route_ifaddrs.c @@ -61,7 +61,7 @@ * By default, interface address routes are added to the fib of the interface. * Once set to non-zero, adds interface address route to all fibs. */ -VNET_DEFINE(u_int, rt_add_addr_allfibs) = 1; +VNET_DEFINE(u_int, rt_add_addr_allfibs) = 0; SYSCTL_UINT(_net, OID_AUTO, add_addr_allfibs, CTLFLAG_RWTUN | CTLFLAG_VNET, &VNET_NAME(rt_add_addr_allfibs), 0, ""); diff --git a/sys/net/route/route_tables.c b/sys/net/route/route_tables.c index eb969cd837b1..e2bbd5ea16a2 100644 --- a/sys/net/route/route_tables.c +++ b/sys/net/route/route_tables.c @@ -183,6 +183,11 @@ grow_rtables(uint32_t num_tables) new_rt_tables = mallocarray(num_tables * (AF_MAX + 1), sizeof(void *), M_RTABLE, M_WAITOK | M_ZERO); + if ((num_tables > 1) && (V_rt_add_addr_allfibs == 0)) + printf("WARNING: Adding ifaddrs to all fibs has been turned off " + "by default. Consider tuning %s if needed\n", + "net.add_addr_allfibs"); + /* * Current rt_tables layout: * fib0[af0, af1, af2, .., AF_MAX]fib1[af0, af1, af2, .., Af_MAX]..