summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_route.c
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/bgp_route.c')
-rw-r--r--bgpd/bgp_route.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 8b94892b3..672c43b37 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -4923,6 +4923,7 @@ void bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
bool force_evpn_import = false;
safi_t orig_safi = safi;
struct bgp_labels bgp_labels = {};
+ struct bgp_route_evpn *p_evpn = evpn;
uint8_t i;
if (frrtrace_enabled(frr_bgp, process_update)) {
@@ -4964,11 +4965,9 @@ void bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
* will not be interned. In which case, it is ok to update the
* attr->evpn_overlay, so that, this can be stored in adj_in.
*/
- if (evpn) {
- if (afi == AFI_L2VPN)
- bgp_attr_set_evpn_overlay(attr, evpn);
- else
- evpn_overlay_free(evpn);
+ if (evpn && afi == AFI_L2VPN) {
+ bgp_attr_set_evpn_overlay(attr, evpn);
+ p_evpn = NULL;
}
bgp_adj_in_set(dest, peer, attr, addpath_id, &bgp_labels);
}
@@ -5141,11 +5140,9 @@ void bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
* attr->evpn_overlay with evpn directly. Instead memcpy
* evpn to new_atr.evpn_overlay before it is interned.
*/
- if (soft_reconfig && evpn) {
- if (afi == AFI_L2VPN)
- bgp_attr_set_evpn_overlay(&new_attr, evpn);
- else
- evpn_overlay_free(evpn);
+ if (soft_reconfig && evpn && afi == AFI_L2VPN) {
+ bgp_attr_set_evpn_overlay(&new_attr, evpn);
+ p_evpn = NULL;
}
/* Apply incoming route-map.
@@ -5314,7 +5311,8 @@ void bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
bgp_dest_unlock_node(dest);
bgp_attr_unintern(&attr_new);
-
+ if (p_evpn)
+ evpn_overlay_free(p_evpn);
return;
}
@@ -5479,6 +5477,8 @@ void bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
ret = bgp_damp_update(pi, dest, afi, safi);
if (ret == BGP_DAMP_SUPPRESSED) {
bgp_dest_unlock_node(dest);
+ if (p_evpn)
+ evpn_overlay_free(p_evpn);
return;
}
}
@@ -5565,6 +5565,8 @@ void bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
type, sub_type, NULL);
}
#endif
+ if (p_evpn)
+ evpn_overlay_free(p_evpn);
return;
} // End of implicit withdraw
@@ -5659,6 +5661,8 @@ void bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
}
#endif
+ if (p_evpn)
+ evpn_overlay_free(p_evpn);
return;
/* This BGP update is filtered. Log the reason then update BGP
@@ -5722,6 +5726,8 @@ filtered:
}
#endif
+ if (p_evpn)
+ evpn_overlay_free(p_evpn);
return;
}