diff options
| author | Russ White <russ@riw.us> | 2025-03-18 08:47:12 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-18 08:47:12 -0400 |
| commit | b2f25186146ec738c3f25b46420afd803a9cf060 (patch) | |
| tree | 7769d7f17e13966bc9be94c84cdab605858f2f5c | |
| parent | 7c791c053c3215d5e600cba7ce61b95b0dfe7c3a (diff) | |
| parent | 518d3fab755d2d0c2cd07c6a67092bd738c060bd (diff) | |
Merge pull request #18411 from opensourcerouting/fix/cherry-picks_bgp_10.2
bgpd: Backport recent changes for 10.2 regarding EVPN pointer changes
| -rw-r--r-- | bgpd/bgp_route.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 58550c70c9..39bff576eb 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -4642,10 +4642,12 @@ 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 ((afi == AFI_L2VPN) && evpn) - bgp_attr_set_evpn_overlay(attr, evpn); - else - evpn_overlay_free(evpn); + if (evpn) { + if (afi == AFI_L2VPN) + bgp_attr_set_evpn_overlay(attr, evpn); + else + evpn_overlay_free(evpn); + } bgp_adj_in_set(dest, peer, attr, addpath_id, &bgp_labels); } @@ -4821,10 +4823,12 @@ 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 && (afi == AFI_L2VPN) && evpn) - bgp_attr_set_evpn_overlay(&new_attr, evpn); - else - evpn_overlay_free(evpn); + if (soft_reconfig && evpn) { + if (afi == AFI_L2VPN) + bgp_attr_set_evpn_overlay(&new_attr, evpn); + else + evpn_overlay_free(evpn); + } /* Apply incoming route-map. * NB: new_attr may now contain newly allocated values from route-map @@ -4889,7 +4893,7 @@ void bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id, goto filtered; } - if (bgp_mac_entry_exists(p) || bgp_mac_exist(&attr->rmac)) { + if (safi == SAFI_EVPN && (bgp_mac_entry_exists(p) || bgp_mac_exist(&attr->rmac))) { peer->stat_pfx_nh_invalid++; reason = "self mac;"; bgp_attr_flush(&new_attr); |
