bgpd: Fix peer determination from parent for imported routes

When routes are imported into a VRF from the global VPN table, the
parent instance is either the default instance in the case of L3VPN or
the source VRF in the case of VRF-to-VRF route leaking. Hence, obtain
the source peer by just looking at the parent route information.

Ticket: CM-20283
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
This commit is contained in:
vivek 2018-03-28 22:11:30 -07:00 committed by Donald Sharp
parent 53089bec65
commit 1ec90b5ede

View File

@ -1082,16 +1082,9 @@ void bgp_zebra_announce(struct bgp_node *rn, struct prefix *p,
if (info->type == ZEBRA_ROUTE_BGP
&& info->sub_type == BGP_ROUTE_IMPORTED) {
struct bgp_info *bi;
/*
* Look at parent chain for peer sort
*/
for (bi = info; bi->extra && bi->extra->parent;
bi = bi->extra->parent) {
peer = ((struct bgp_info *)(bi->extra->parent))->peer;
}
/* Obtain peer from parent */
if (info->extra && info->extra->parent)
peer = ((struct bgp_info *)(info->extra->parent))->peer;
}
tag = info->attr->tag;