Merge pull request #16082 from FRRouting/mergify/bp/stable/10.0/pr-16044

bgpd: fix route leaking from the default l3vrf (backport #16044)
This commit is contained in:
Donald Sharp 2024-05-24 10:29:30 -04:00 committed by GitHub
commit 80f125d8b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 5 deletions

View File

@ -2230,8 +2230,9 @@ static void vpn_leak_to_vrf_update_onevrf(struct bgp *to_bgp, /* to */
* Let the kernel to decide with double lookup the real next-hop * Let the kernel to decide with double lookup the real next-hop
* interface when installing the route. * interface when installing the route.
*/ */
if (src_bgp || bpi_ultimate->sub_type == BGP_ROUTE_STATIC || if (src_vrf->vrf_id != VRF_DEFAULT &&
bpi_ultimate->sub_type == BGP_ROUTE_REDISTRIBUTE) { (src_bgp || bpi_ultimate->sub_type == BGP_ROUTE_STATIC ||
bpi_ultimate->sub_type == BGP_ROUTE_REDISTRIBUTE)) {
ifp = if_get_vrf_loopback(src_vrf->vrf_id); ifp = if_get_vrf_loopback(src_vrf->vrf_id);
if (ifp) if (ifp)
static_attr.nh_ifindex = ifp->ifindex; static_attr.nh_ifindex = ifp->ifindex;

View File

@ -116,7 +116,7 @@ def test_vrf_route_leak_donna():
"nexthops": [ "nexthops": [
{ {
"fib": True, "fib": True,
"interfaceName": "lo", "interfaceName": "dummy0",
"vrf": "default", "vrf": "default",
"active": True, "active": True,
}, },

View File

@ -1,9 +1,9 @@
VRF ray: VRF ray:
B 10.0.1.0/24 [20/20] via 10.0.20.1, r2-eth1 (vrf default) inactive, weight 1, XX:XX:XX B 10.0.1.0/24 [20/20] via 10.0.20.1, r2-eth1 (vrf default) inactive, weight 1, XX:XX:XX
B 10.0.2.0/24 [20/0] is directly connected, lo (vrf default) inactive, weight 1, XX:XX:XX B 10.0.2.0/24 [20/0] is directly connected, r2-eth0 (vrf default) inactive, weight 1, XX:XX:XX
B>* 10.0.3.0/24 [20/20] via 10.0.20.1, r2-eth1 (vrf default), weight 1, XX:XX:XX B>* 10.0.3.0/24 [20/20] via 10.0.20.1, r2-eth1 (vrf default), weight 1, XX:XX:XX
O>* 10.0.4.0/24 [110/20] via 10.0.40.4, r2-eth2, weight 1, XX:XX:XX O>* 10.0.4.0/24 [110/20] via 10.0.40.4, r2-eth2, weight 1, XX:XX:XX
B 10.0.20.0/24 [20/0] is directly connected, lo (vrf default) inactive, weight 1, XX:XX:XX B 10.0.20.0/24 [20/0] is directly connected, r2-eth1 (vrf default) inactive, weight 1, XX:XX:XX
B>* 10.0.30.0/24 [20/20] via 10.0.20.1, r2-eth1 (vrf default), weight 1, XX:XX:XX B>* 10.0.30.0/24 [20/20] via 10.0.20.1, r2-eth1 (vrf default), weight 1, XX:XX:XX
O 10.0.40.0/24 [110/10] is directly connected, r2-eth2, weight 1, XX:XX:XX O 10.0.40.0/24 [110/10] is directly connected, r2-eth2, weight 1, XX:XX:XX
C>* 10.0.40.0/24 is directly connected, r2-eth2, XX:XX:XX C>* 10.0.40.0/24 is directly connected, r2-eth2, XX:XX:XX