summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <donaldsharp72@gmail.com>2025-03-06 09:59:19 -0500
committerDonald Sharp <donaldsharp72@gmail.com>2025-03-06 09:59:19 -0500
commit0758aa10a8c559b0f371ac2d458399d9f34328d3 (patch)
tree91687dc607d8ca640503465fcc16ba1ef52f3d2f
parentf3a7077df01176164c0bb5775ecb886cf233089e (diff)
bgpd: Fix dead code in bgp_route.c #1637664
Coverity rightly points out that the worse pointer cannot be null in this section of code. Fix it. Signed-off-by: Donald Sharp <donaldsharp72@gmail.com>
-rw-r--r--bgpd/bgp_route.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 9b3053ff25..a7825165e7 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -3281,11 +3281,8 @@ void bgp_best_selection(struct bgp *bgp, struct bgp_dest *dest,
if (worse->prev)
worse->prev->next = first;
first->next = worse;
- if (worse) {
- first->prev = worse->prev;
- worse->prev = first;
- } else
- first->prev = NULL;
+ first->prev = worse->prev;
+ worse->prev = first;
if (dest->info == worse) {
bgp_dest_set_bgp_path_info(dest, first);