From 94d12dc490d7c4109828e7d4421e7ae0d84c3448 Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Fri, 9 Feb 2024 16:28:23 +0100 Subject: [PATCH] bgpd: update route leak when vrf appears If the VRF is not yet created and a BGP instance is created for the VRF, dependent leaked routes are inactive, which is normal. However, when the VRF interface appears, they remains inactive. Update route leak when a VRF interface appears. Note that routes to a deleted VRF are already removed by zebra. Signed-off-by: Louis Scalbert --- bgpd/bgp_zebra.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 54b792af29..0304c4383f 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -3160,6 +3160,15 @@ static int bgp_ifp_create(struct interface *ifp) bgp_update_interface_nbrs(bgp, ifp, ifp); hook_call(bgp_vrf_status_changed, bgp, ifp); + + if (bgp_get_default() && if_is_loopback(ifp)) { + vpn_leak_zebra_vrf_label_update(bgp, AFI_IP); + vpn_leak_zebra_vrf_label_update(bgp, AFI_IP6); + vpn_leak_zebra_vrf_sid_update(bgp, AFI_IP); + vpn_leak_zebra_vrf_sid_update(bgp, AFI_IP6); + vpn_leak_postchange_all(); + } + return 0; } -- 2.39.5