]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: In bgp_update() for mac addrs ensure we are dealing with evpn
authorDonald Sharp <sharpd@nvidia.com>
Wed, 30 Oct 2024 17:11:35 +0000 (13:11 -0400)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Mon, 17 Mar 2025 12:57:14 +0000 (14:57 +0200)
The code is just arbitrarily checking to see if there are any
mac addresses associated with a prefix.  This makes no
sense from the perspective that it can only happen as
an evpn route.  Let's not make non-evpn people pay
the price to check this data.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
bgpd/bgp_route.c

index 58550c70c92941c973ca571195e4c5c91176d7d0..4a36f1a26d334907091c01ceb0492b8cab3c6579 100644 (file)
@@ -4889,7 +4889,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);