summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2023-09-20 09:58:13 +0300
committerGitHub <noreply@github.com>2023-09-20 09:58:13 +0300
commit4be71e900c133bb52151a8b9fcc9c83f3c604eca (patch)
treed9c77021188a80a1c12b5e537f7d072d00de676c
parent7a80a235aff3974be530c5c9b8c4c3dfb35a99f3 (diff)
parent250518f8c6b0e4904b5dcf6073fd3841ce7ff4d6 (diff)
Merge pull request #14445 from donaldsharp/use_my_cabbage
couple bgp coverity issues
-rw-r--r--bgpd/bgp_evpn.c4
-rw-r--r--bgpd/bgp_mplsvpn.c3
-rw-r--r--bgpd/bgp_route.c4
-rw-r--r--bgpd/bgp_route.h3
4 files changed, 8 insertions, 6 deletions
diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c
index aa23f06762..ad101f171a 100644
--- a/bgpd/bgp_evpn.c
+++ b/bgpd/bgp_evpn.c
@@ -1722,8 +1722,8 @@ static void bgp_evpn_get_sync_info(struct bgp *bgp, esi_t *esi,
continue;
}
- if (bgp_evpn_path_info_cmp(bgp, tmp_pi,
- second_best_path, &paths_eq))
+ if (bgp_evpn_path_info_cmp(bgp, tmp_pi, second_best_path,
+ &paths_eq, false))
second_best_path = tmp_pi;
}
diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c
index 9b5d568636..00930dea6b 100644
--- a/bgpd/bgp_mplsvpn.c
+++ b/bgpd/bgp_mplsvpn.c
@@ -1179,12 +1179,13 @@ leak_update(struct bgp *to_bgp, struct bgp_dest *bn,
/* Process change. */
bgp_aggregate_increment(to_bgp, p, bpi, afi, safi);
bgp_process(to_bgp, bn, afi, safi);
- bgp_dest_unlock_node(bn);
if (debug)
zlog_debug("%s: ->%s: %pBD Found route, changed attr",
__func__, to_bgp->name_pretty, bn);
+ bgp_dest_unlock_node(bn);
+
return bpi;
}
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index df3397af99..1e4334ed5f 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -1493,11 +1493,11 @@ int bgp_path_info_cmp(struct bgp *bgp, struct bgp_path_info *new,
int bgp_evpn_path_info_cmp(struct bgp *bgp, struct bgp_path_info *new,
- struct bgp_path_info *exist, int *paths_eq)
+ struct bgp_path_info *exist, int *paths_eq,
+ bool debug)
{
enum bgp_path_selection_reason reason;
char pfx_buf[PREFIX2STR_BUFFER] = {};
- bool debug = false;
if (debug)
prefix2str(bgp_dest_get_prefix(new->net), pfx_buf,
diff --git a/bgpd/bgp_route.h b/bgpd/bgp_route.h
index 7470954bf7..54fad03e6d 100644
--- a/bgpd/bgp_route.h
+++ b/bgpd/bgp_route.h
@@ -896,7 +896,8 @@ extern bool bgp_update_martian_nexthop(struct bgp *bgp, afi_t afi, safi_t safi,
uint8_t type, uint8_t stype,
struct attr *attr, struct bgp_dest *dest);
extern int bgp_evpn_path_info_cmp(struct bgp *bgp, struct bgp_path_info *new,
- struct bgp_path_info *exist, int *paths_eq);
+ struct bgp_path_info *exist, int *paths_eq,
+ bool debug);
extern void bgp_aggregate_toggle_suppressed(struct bgp_aggregate *aggregate,
struct bgp *bgp,
const struct prefix *p, afi_t afi,