diff options
author | Mitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com> | 2017-11-21 11:42:05 +0100 |
---|---|---|
committer | mitesh <mitesh@cumulusnetworks.com> | 2018-01-24 00:58:53 +0100 |
commit | b57ba6d2a893e196fbc96e5ab8ca17d0f8ddf171 (patch) | |
tree | 8153d61f0934deb6ea3ef4bb527f59c9efcb6625 /bgpd/bgp_route.h | |
parent | bgpd: bgpd crash in update all type2 routes (diff) | |
download | frr-b57ba6d2a893e196fbc96e5ab8ca17d0f8ddf171.tar.xz frr-b57ba6d2a893e196fbc96e5ab8ca17d0f8ddf171.zip |
bgpd: carry two MPLS labels in EVPN NLRIs
When doing symmetric routing,
EVPN type-2 (MACIP) routes need to be advertised with two labels (VNIs)
the first being the L2 VNI (identifying the VLAN) and
the second being the L3 VNI (identifying the VRF).
The receive processing needs to handle one or two labels too.
Ticket: CM-18489
Review: CCR-6949
Testing: manual and bgp/evpn/mpls smoke
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Diffstat (limited to 'bgpd/bgp_route.h')
-rw-r--r-- | bgpd/bgp_route.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/bgpd/bgp_route.h b/bgpd/bgp_route.h index ae4759aad..cd4d027c6 100644 --- a/bgpd/bgp_route.h +++ b/bgpd/bgp_route.h @@ -59,6 +59,11 @@ enum bgp_show_type { #define BGP_SHOW_OCODE_HEADER "Origin codes: i - IGP, e - EGP, ? - incomplete\n\n" #define BGP_SHOW_HEADER " Network Next Hop Metric LocPrf Weight Path\n" +/* Maximum number of labels we can process or send with a prefix. We + * really do only 1 for MPLS (BGP-LU) but we can do 2 for EVPN-VxLAN. + */ +#define BGP_MAX_LABELS 2 + /* Ancillary information to struct bgp_info, * used for uncommonly used data (aggregation, MPLS, etc.) * and lazily allocated to save memory. @@ -73,11 +78,9 @@ struct bgp_info_extra { /* Nexthop reachability check. */ u_int32_t igpmetric; - /* MPLS label - L2VNI */ - mpls_label_t label; - - /* MPLS label - L3-VNI */ - mpls_label_t label2; + /* MPLS label(s) - VNI(s) for EVPN-VxLAN */ + mpls_label_t label[BGP_MAX_LABELS]; + u_int32_t num_labels; #if ENABLE_BGP_VNC union { @@ -360,10 +363,10 @@ extern int bgp_static_unset_safi(afi_t afi, safi_t safi, struct vty *, /* this is primarily for MPLS-VPN */ extern int bgp_update(struct peer *, struct prefix *, u_int32_t, struct attr *, afi_t, safi_t, int, int, struct prefix_rd *, - mpls_label_t *, int, struct bgp_route_evpn *); + mpls_label_t *, u_int32_t, int, struct bgp_route_evpn *); extern int bgp_withdraw(struct peer *, struct prefix *, u_int32_t, struct attr *, afi_t, safi_t, int, int, - struct prefix_rd *, mpls_label_t *, + struct prefix_rd *, mpls_label_t *, u_int32_t, struct bgp_route_evpn *); /* for bgp_nexthop and bgp_damp */ |