]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: Fix peer determination from parent for imported routes
authorvivek <vivek@cumulusnetworks.com>
Thu, 29 Mar 2018 05:11:30 +0000 (22:11 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 25 Apr 2018 16:39:16 +0000 (12:39 -0400)
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>
bgpd/bgp_zebra.c

index 1c3229174049ff1112f7dca7775f03e90a622d0b..7872897234cafa4546d8ead7c085be3db8cd8828 100644 (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;