summaryrefslogtreecommitdiff
path: root/bgpd/bgp_evpn.h
diff options
context:
space:
mode:
authorvivek <vivek@cumulusnetworks.com>2019-03-01 07:17:16 +0000
committervivek <vivek@cumulusnetworks.com>2019-03-01 07:17:16 +0000
commit08e68f925e274989c09249449c12f8870604ad5d (patch)
tree246697fb5a520483590571070763f3298f8d1621 /bgpd/bgp_evpn.h
parent744c63be132a4644c7c3799a0f0d2a07bfc5b98a (diff)
bgpd: Recursively determine if route's source is EVPN
With leaking of IPv4 or IPv6 unicast routes whose source is a EVPN type-2 or type-5 route between VRFs, the determination of whether the route's source is EVPN has to be made recursively. This is used during route install to pass along appropriate parameters to zebra. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'bgpd/bgp_evpn.h')
-rw-r--r--bgpd/bgp_evpn.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/bgpd/bgp_evpn.h b/bgpd/bgp_evpn.h
index 0027ae51a4..dfe141c40e 100644
--- a/bgpd/bgp_evpn.h
+++ b/bgpd/bgp_evpn.h
@@ -88,8 +88,13 @@ static inline int is_route_parent_evpn(struct bgp_path_info *ri)
!ri->extra->parent)
return 0;
- /* See if the parent is of family L2VPN/EVPN */
- parent_ri = (struct bgp_path_info *)ri->extra->parent;
+ /* Determine parent recursively */
+ for (parent_ri = ri->extra->parent;
+ parent_ri->extra && parent_ri->extra->parent;
+ parent_ri = parent_ri->extra->parent)
+ ;
+
+ /* See if of family L2VPN/EVPN */
rn = parent_ri->net;
if (!rn)
return 0;