From 67bd620c9d34cf34d0f37ea773dc210222d7d582 Mon Sep 17 00:00:00 2001 From: vivek Date: Mon, 16 Sep 2019 18:28:44 -0700 Subject: [PATCH] bgpd: Fix router-id update handling for route-leaking If the default BGP instance is importing routes from another instance and the latter has a router-id update, the update handler needs to handle the default instance in a special way. Signed-off-by: Vivek Venkatraman Reviewed-by: Chirag Shah Reviewed-by: Don Slice Ticket: CM-26007 Reviewed By: CCR-9108 Testing Done: Detailed verification in 3.x --- bgpd/bgp_mplsvpn.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c index 86c04b71f0..8758d0ca78 100644 --- a/bgpd/bgp_mplsvpn.c +++ b/bgpd/bgp_mplsvpn.c @@ -1532,7 +1532,10 @@ void vpn_handle_router_id_update(struct bgp *bgp, bool withdraw, ecom = bgp->vpn_policy[afi].rtlist[edir]; for (ALL_LIST_ELEMENTS_RO(bgp->vpn_policy[afi]. export_vrf, node, vname)) { - bgp_import = bgp_lookup_by_name(vname); + if (strcmp(vname, VRF_DEFAULT_NAME) == 0) + bgp_import = bgp_get_default(); + else + bgp_import = bgp_lookup_by_name(vname); if (!bgp_import) continue; @@ -1572,7 +1575,10 @@ void vpn_handle_router_id_update(struct bgp *bgp, bool withdraw, ecom = bgp->vpn_policy[afi].rtlist[edir]; for (ALL_LIST_ELEMENTS_RO(bgp->vpn_policy[afi]. export_vrf, node, vname)) { - bgp_import = bgp_lookup_by_name(vname); + if (strcmp(vname, VRF_DEFAULT_NAME) == 0) + bgp_import = bgp_get_default(); + else + bgp_import = bgp_lookup_by_name(vname); if (!bgp_import) continue; if (bgp_import->vpn_policy[afi].rtlist[idir]) -- 2.39.5