bgpd: Remove set but unused variables

Found by clang 15.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
Donald Sharp 2023-02-28 18:19:52 +00:00
parent 328b64fcb5
commit 2cc428bee2
4 changed files with 3 additions and 41 deletions

View File

@ -127,7 +127,6 @@ void rfapiCheckRouteCount(void)
struct agg_node *rn;
int holddown_count = 0;
int local_count = 0;
int imported_count = 0;
int remote_count = 0;
@ -146,9 +145,7 @@ void rfapiCheckRouteCount(void)
++holddown_count;
} else {
if (RFAPI_LOCAL_BI(bpi)) {
++local_count;
} else {
if (!RFAPI_LOCAL_BI(bpi)) {
if (RFAPI_DIRECT_IMPORT_BI(
bpi)) {
++imported_count;

View File

@ -116,7 +116,6 @@ void rfapiRibCheckCounts(
struct bgp *bgp = bgp_get_default();
uint32_t t_pfx_active = 0;
uint32_t t_pfx_deleted = 0;
uint32_t t_ri_active = 0;
uint32_t t_ri_deleted = 0;
@ -131,7 +130,6 @@ void rfapiRibCheckCounts(
afi_t afi;
uint32_t pfx_active = 0;
uint32_t pfx_deleted = 0;
for (afi = AFI_IP; afi < AFI_MAX; ++afi) {
@ -156,8 +154,6 @@ void rfapiRibCheckCounts(
if (dsl) {
ri_deleted = skiplist_count(dsl);
t_ri_deleted += ri_deleted;
++pfx_deleted;
++t_pfx_deleted;
}
}
for (rn = agg_route_top(rfd->rib_pending[afi]); rn;
@ -2303,10 +2299,6 @@ void rfapiRibShowResponses(void *stream, struct prefix *pfx_match,
int printedheader = 0;
int routes_total = 0;
int nhs_total = 0;
int prefixes_total = 0;
int prefixes_displayed = 0;
int nves_total = 0;
int nves_with_routes = 0;
int nves_displayed = 0;
int routes_displayed = 0;
int nhs_displayed = 0;
@ -2326,10 +2318,6 @@ void rfapiRibShowResponses(void *stream, struct prefix *pfx_match,
int printednve = 0;
afi_t afi;
++nves_total;
if (rfd->rib_prefix_count)
++nves_with_routes;
for (afi = AFI_IP; afi < AFI_MAX; ++afi) {
struct agg_node *rn;
@ -2355,14 +2343,11 @@ void rfapiRibShowResponses(void *stream, struct prefix *pfx_match,
routes_total++;
nhs_total += skiplist_count(sl);
++prefixes_total;
if (pfx_match && !prefix_match(pfx_match, p)
&& !prefix_match(p, pfx_match))
continue;
++prefixes_displayed;
if (!printedheader) {
++printedheader;

View File

@ -822,11 +822,6 @@ int rfapiShowVncQueries(void *stream, struct prefix *pfx_match)
const char *vty_newline;
int printedheader = 0;
int nves_total = 0;
int nves_with_queries = 0;
int nves_displayed = 0;
int queries_total = 0;
int queries_displayed = 0;
@ -850,15 +845,9 @@ int rfapiShowVncQueries(void *stream, struct prefix *pfx_match)
struct agg_node *rn;
int printedquerier = 0;
++nves_total;
if (rfd->mon
|| (rfd->mon_eth && skiplist_count(rfd->mon_eth))) {
++nves_with_queries;
} else {
if (!rfd->mon &&
!(rfd->mon_eth && skiplist_count(rfd->mon_eth)))
continue;
}
/*
* IP Queries
@ -904,8 +893,6 @@ int rfapiShowVncQueries(void *stream, struct prefix *pfx_match)
fp(out, "%-15s %-15s", buf_vn, buf_un);
printedquerier = 1;
++nves_displayed;
} else
fp(out, "%-15s %-15s", "", "");
buf_remain[0] = 0;
@ -978,8 +965,6 @@ int rfapiShowVncQueries(void *stream, struct prefix *pfx_match)
fp(out, "%-15s %-15s", buf_vn, buf_un);
printedquerier = 1;
++nves_displayed;
} else
fp(out, "%-15s %-15s", "", "");
buf_remain[0] = 0;

View File

@ -1986,8 +1986,6 @@ void vnc_import_bgp_exterior_add_route_interior(
if (RFAPI_HAS_MONITOR_EXTERIOR(rn_interior)) {
int count = 0; /* debugging */
vnc_zlog_debug_verbose(
"%s: has exterior monitor; ext src: %p", __func__,
RFAPI_MONITOR_EXTERIOR(rn_interior)->source);
@ -2011,9 +2009,6 @@ void vnc_import_bgp_exterior_add_route_interior(
struct attr new_attr;
uint32_t label = 0;
++count; /* debugging */
assert(bpi_exterior);
assert(pfx_exterior);