]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: update route leak when vrf appears
authorLouis Scalbert <louis.scalbert@6wind.com>
Fri, 9 Feb 2024 15:28:23 +0000 (16:28 +0100)
committerLouis Scalbert <louis.scalbert@6wind.com>
Wed, 14 Feb 2024 15:39:51 +0000 (16:39 +0100)
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 <louis.scalbert@6wind.com>
bgpd/bgp_zebra.c

index 54b792af29d9e172349bc680dfba8a67d922d09c..0304c4383f3d92a0a515159a02a176593337def0 100644 (file)
@@ -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;
 }