Merge pull request #17251 from donaldsharp/bgp_best_path_evpn_issue

bgpd: bestpath failure when you have a singlepath not in holddown
This commit is contained in:
Russ White 2024-10-29 10:16:37 -04:00 committed by GitHub
commit 56495a88df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3198,15 +3198,23 @@ void bgp_best_selection(struct bgp *bgp, struct bgp_dest *dest,
struct bgp_path_info *end =
bgp_dest_get_bgp_path_info(dest);
for (; end && end->next != NULL; end = end->next)
;
if (end && any_comparisons) {
for (; end && end->next != NULL; end = end->next)
;
if (end)
end->next = first;
else
if (end)
end->next = first;
else
bgp_dest_set_bgp_path_info(dest, first);
first->prev = end;
first->next = NULL;
} else {
bgp_dest_set_bgp_path_info(dest, first);
first->prev = end;
first->next = NULL;
if (end)
end->prev = first;
first->next = end;
first->prev = NULL;
}
dest->reason = first->reason;
} else {