summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeal Shrader <neal@digitalocean.com>2021-05-06 20:51:06 +0200
committerNeal Shrader <neal@digitalocean.com>2021-05-10 21:35:57 +0200
commit5df26422921a943c056aab282b844b43416ac411 (patch)
treefd44e9262c5096dfc5dfa2c7f2e7c68f18792b0f
parentMerge pull request #8638 from ton31337/fix/bgp_doc (diff)
downloadfrr-5df26422921a943c056aab282b844b43416ac411.tar.xz
frr-5df26422921a943c056aab282b844b43416ac411.zip
bgpd: scope evpn specific path selection to type-2 routes
For EVPN routes, there is specific logic in place for path selection surrounding MAC Mobility. For pure type-5 routes, if a route is advertised with a MED, this is ignored since it ultimately falls inside of the EVPN specific path selection logic, and ultimately selects the lower IP address. This change ensures only type-2 routes fall into the EVPN BGP path selection. Signed-off-by: Neal Shrader <neal@digitalocean.com>
-rw-r--r--bgpd/bgp_route.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 77a0b5fea..2c792b7ab 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -550,6 +550,7 @@ static int bgp_path_info_cmp(struct bgp *bgp, struct bgp_path_info *new,
char *pfx_buf, afi_t afi, safi_t safi,
enum bgp_path_selection_reason *reason)
{
+ const struct prefix *new_p;
struct attr *newattr, *existattr;
bgp_peer_sort_t new_sort;
bgp_peer_sort_t exist_sort;
@@ -614,10 +615,13 @@ static int bgp_path_info_cmp(struct bgp *bgp, struct bgp_path_info *new,
newattr = new->attr;
existattr = exist->attr;
+ new_p = bgp_dest_get_prefix(new->net);
+
/* For EVPN routes, we cannot just go by local vs remote, we have to
* look at the MAC mobility sequence number, if present.
*/
- if (safi == SAFI_EVPN) {
+ if ((safi == SAFI_EVPN)
+ && (new_p->u.prefix_evpn.route_type == BGP_EVPN_MAC_IP_ROUTE)) {
/* This is an error condition described in RFC 7432 Section
* 15.2. The RFC
* states that in this scenario "the PE MUST alert the operator"
@@ -630,9 +634,9 @@ static int bgp_path_info_cmp(struct bgp *bgp, struct bgp_path_info *new,
*/
if (newattr->sticky != existattr->sticky) {
if (!debug) {
- prefix2str(
- bgp_dest_get_prefix(new->net), pfx_buf,
- sizeof(*pfx_buf) * PREFIX2STR_BUFFER);
+ prefix2str(new_p, pfx_buf,
+ sizeof(*pfx_buf)
+ * PREFIX2STR_BUFFER);
bgp_path_info_path_with_addpath_rx_str(
new, new_buf, sizeof(new_buf));
bgp_path_info_path_with_addpath_rx_str(