]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Set LLGR stale routes for all the paths including addpath
authorDonatas Abraitis <donatas@opensourcerouting.org>
Thu, 7 Nov 2024 11:08:35 +0000 (13:08 +0200)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Fri, 8 Nov 2024 08:02:21 +0000 (10:02 +0200)
Without this patch we set only the first path for the route (if multiple exist)
as LLGR stale and stop doing that for the rest of the paths, which is wrong.

Fixes: 1479ed2fb35f4a5ae1017201a7ee37ba2727163a ("bgpd: Implement LLGR helper mode")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd/bgp_fsm.c

index af2ef4c839dadf94c5685f7bf606a294d3ed23a6..dc75e137d6ae659e5965058d81119e7a265b928d 100644 (file)
@@ -722,6 +722,11 @@ static void bgp_set_llgr_stale(struct peer *peer, afi_t afi, safi_t safi)
                                                    COMMUNITY_NO_LLGR))
                                                continue;
 
+                                       if (bgp_attr_get_community(pi->attr) &&
+                                           community_include(bgp_attr_get_community(pi->attr),
+                                                             COMMUNITY_LLGR_STALE))
+                                               continue;
+
                                        if (bgp_debug_neighbor_events(peer))
                                                zlog_debug(
                                                        "%pBP Long-lived set stale community (LLGR_STALE) for: %pFX",
@@ -732,8 +737,6 @@ static void bgp_set_llgr_stale(struct peer *peer, afi_t afi, safi_t safi)
                                        pi->attr = bgp_attr_intern(&attr);
                                        bgp_recalculate_afi_safi_bestpaths(
                                                peer->bgp, afi, safi);
-
-                                       break;
                                }
                }
        } else {
@@ -750,6 +753,11 @@ static void bgp_set_llgr_stale(struct peer *peer, afi_t afi, safi_t safi)
                                            COMMUNITY_NO_LLGR))
                                        continue;
 
+                               if (bgp_attr_get_community(pi->attr) &&
+                                   community_include(bgp_attr_get_community(pi->attr),
+                                                     COMMUNITY_LLGR_STALE))
+                                       continue;
+
                                if (bgp_debug_neighbor_events(peer))
                                        zlog_debug(
                                                "%pBP Long-lived set stale community (LLGR_STALE) for: %pFX",
@@ -760,8 +768,6 @@ static void bgp_set_llgr_stale(struct peer *peer, afi_t afi, safi_t safi)
                                pi->attr = bgp_attr_intern(&attr);
                                bgp_recalculate_afi_safi_bestpaths(peer->bgp,
                                                                   afi, safi);
-
-                               break;
                        }
        }
 }