From db1c2223fde18824747355592c8a0f2504fa954b Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Mon, 8 Aug 2022 12:32:15 -0400 Subject: [PATCH] zebra: Don't install connected routes multiple times into FRR When moving an interface between vrf's we do not need to install the connected routes multiple times. eva# show ip route vrf all Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP, F - PBR, f - OpenFabric, > - selected route, * - FIB route, q - queued, r - rejected, b - backup t - trapped, o - offload failure VRF BLUE: C>* 4.5.6.7/32 is directly connected, dummy7, 00:00:10 VRF default: K>* 0.0.0.0/0 [0/100] via 192.168.119.1, enp39s0, 00:00:10 C>* 192.168.119.0/24 is directly connected, enp39s0, 00:00:10 eva# exit sharpd@eva ~/f/t/topotests (multiple_connected_installs)> sudo ip link add GREEN type vrf table 11000 sharpd@eva ~/f/t/topotests (multiple_connected_installs)> sudo ip link set GREEN up sharpd@eva ~/f/t/topotests (multiple_connected_installs)> sudo ip link set dummy7 master GREEN sharpd@eva ~/f/t/topotests (multiple_connected_installs)> vtysh Hello, this is FRRouting (version 8.4-dev). Copyright 1996-2005 Kunihiro Ishiguro, et al. eva# show ip route vrf all Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP, F - PBR, f - OpenFabric, > - selected route, * - FIB route, q - queued, r - rejected, b - backup t - trapped, o - offload failure VRF GREEN: C>* 4.5.6.7/32 is directly connected, dummy7, 00:00:05 VRF default: K>* 0.0.0.0/0 [0/100] via 192.168.119.1, enp39s0, 00:01:03 C>* 192.168.119.0/24 is directly connected, enp39s0, 00:01:03 eva# exit sharpd@eva ~/f/t/topotests (multiple_connected_installs)> sudo ip link set dummy7 nomaster sharpd@eva ~/f/t/topotests (multiple_connected_installs)> sudo vtysh -c "show ip route vrf all" Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP, F - PBR, f - OpenFabric, > - selected route, * - FIB route, q - queued, r - rejected, b - backup t - trapped, o - offload failure VRF default: K>* 0.0.0.0/0 [0/100] via 192.168.119.1, enp39s0, 00:03:22 C>* 4.5.6.7/32 is directly connected, dummy7, 00:00:08 C>* 192.168.119.0/24 is directly connected, enp39s0, 00:03:22 sharpd@eva ~/f/t/topotests (multiple_connected_installs)> @ 11 0:-* 5h50m 0.06 24x1.9GHz 31.4G26% 426G70% 2022-08-08 13:49:24 Signed-off-by: Donald Sharp --- zebra/interface.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/zebra/interface.c b/zebra/interface.c index b7a984e44d..205fa88293 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -848,10 +848,6 @@ void if_handle_vrf_change(struct interface *ifp, vrf_id_t vrf_id) /* Send out notification on interface VRF change. */ /* This is to issue an ADD, if needed. */ zebra_interface_vrf_update_add(ifp, old_vrf_id); - - /* Install connected routes (in new VRF). */ - if (if_is_operative(ifp)) - if_install_connected(ifp); } static void ipv6_ll_address_to_mac(struct in6_addr *address, uint8_t *mac) -- 2.39.5