summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_evpn.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2020-11-02 16:52:40 +0100
committerDonald Sharp <sharpd@nvidia.com>2020-11-15 15:44:47 +0100
commit2a3f51cf6ba298ab42b7b51a2d879b46baa2ee31 (patch)
tree02cc2648c61ab31a0a80d4c2dbc994807f6103b5 /bgpd/bgp_evpn.c
parentbgpd: Allow NULL to be passed in for ecommunity_free (diff)
downloadfrr-2a3f51cf6ba298ab42b7b51a2d879b46baa2ee31.tar.xz
frr-2a3f51cf6ba298ab42b7b51a2d879b46baa2ee31.zip
bgpd: Add accessor for bgp_attr.pmsi_tnl_type
Add an accessor for the bgp_attr.pmsi_tnl_type to allow us to abstract where it is. Every attribute is paying the price of this bit of data as part of `struct bgp_attr` In the future we'll move it elsewhere. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'bgpd/bgp_evpn.c')
-rw-r--r--bgpd/bgp_evpn.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c
index 67d0a95cb..21eb371ec 100644
--- a/bgpd/bgp_evpn.c
+++ b/bgpd/bgp_evpn.c
@@ -980,7 +980,7 @@ static int evpn_zebra_install(struct bgp *bgp, struct bgpevpn *vpn,
} else if (p->prefix.route_type == BGP_EVPN_AD_ROUTE) {
ret = bgp_evpn_remote_es_evi_add(bgp, vpn, p);
} else {
- switch (pi->attr->pmsi_tnl_type) {
+ switch (bgp_attr_get_pmsi_tnl_type(pi->attr)) {
case PMSI_TNLTYPE_INGR_REPL:
flood_control = VXLAN_FLOOD_HEAD_END_REPL;
break;
@@ -1711,7 +1711,7 @@ static int update_evpn_route(struct bgp *bgp, struct bgpevpn *vpn,
/* PMSI is only needed for type-3 routes */
if (p->prefix.route_type == BGP_EVPN_IMET_ROUTE) {
attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_PMSI_TUNNEL);
- attr.pmsi_tnl_type = PMSI_TNLTYPE_INGR_REPL;
+ bgp_attr_set_pmsi_tnl_type(&attr, PMSI_TNLTYPE_INGR_REPL);
}
if (bgp_debug_zebra(NULL)) {
@@ -3738,12 +3738,14 @@ static int process_type3_route(struct peer *peer, afi_t afi, safi_t safi,
*/
if (attr &&
(attr->flag & ATTR_FLAG_BIT(BGP_ATTR_PMSI_TUNNEL))) {
- if (attr->pmsi_tnl_type != PMSI_TNLTYPE_INGR_REPL &&
- attr->pmsi_tnl_type != PMSI_TNLTYPE_PIM_SM) {
- flog_warn(EC_BGP_EVPN_PMSI_PRESENT,
- "%u:%s - Rx EVPN Type-3 NLRI with unsupported PTA %d",
- peer->bgp->vrf_id, peer->host,
- attr->pmsi_tnl_type);
+ enum pta_type pmsi_tnl_type = bgp_attr_get_pmsi_tnl_type(attr);
+
+ if (pmsi_tnl_type != PMSI_TNLTYPE_INGR_REPL
+ && pmsi_tnl_type != PMSI_TNLTYPE_PIM_SM) {
+ flog_warn(
+ EC_BGP_EVPN_PMSI_PRESENT,
+ "%u:%s - Rx EVPN Type-3 NLRI with unsupported PTA %d",
+ peer->bgp->vrf_id, peer->host, pmsi_tnl_type);
}
}