From fddbafcc9e7380259afd0c97f5332df44d81e112 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 4 Nov 2020 11:47:57 -0500 Subject: [PATCH 1/2] ospfd: Cleanup some clang sa issues This commit tells the compiler we are intentionally ignoring the lsa value returned and not doing anything with ret. Signed-off-by: Donald Sharp --- ospfd/ospf_asbr.c | 4 ++-- ospfd/ospf_vty.c | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ospfd/ospf_asbr.c b/ospfd/ospf_asbr.c index 639f9cb35e..94fa1b5b44 100644 --- a/ospfd/ospf_asbr.c +++ b/ospfd/ospf_asbr.c @@ -416,7 +416,7 @@ static void ospf_aggr_handle_external_info(void *data) aggr = ospf_external_aggr_match(ospf, &ei->p); if (aggr) { - lsa = ospf_originate_summary_lsa(ospf, aggr, ei); + (void)ospf_originate_summary_lsa(ospf, aggr, ei); return; } @@ -424,7 +424,7 @@ static void ospf_aggr_handle_external_info(void *data) if (lsa) ospf_external_lsa_refresh(ospf, lsa, ei, LSA_REFRESH_FORCE, 1); else - lsa = ospf_external_lsa_originate(ospf, ei); + (void)ospf_external_lsa_originate(ospf, ei); } static void ospf_aggr_unlink_external_info(void *data) diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index cfdcde9914..28ee4db3a1 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -11361,8 +11361,7 @@ DEFUN (show_ip_ospf_external_aggregator, return CMD_SUCCESS; } - ret = ospf_show_summary_address(vty, ospf, use_vrf, json, uj, - detail); + ospf_show_summary_address(vty, ospf, use_vrf, json, uj, detail); } else { /* Default Vrf */ From 9ea714e1436fad8b19253fe695ca5178e659b662 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 4 Nov 2020 11:48:49 -0500 Subject: [PATCH 2/2] zebra: Rework code to make SA happy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clan SA was saying: ./zebra/zebra_vty_clippy.c: In function ‘show_route’: zebra/zebra_vty.c:1775:4: warning: ‘zvrf’ may be used uninitialized in this function [-Wmaybe-uninitialized] do_show_ip_route_all(vty, zvrf, afi, !!fib, !!json, tag, ^ I do not see a way that zvrf could ever be uninited in the code path but rearrange the code a tiny bit to make it happier. Signed-off-by: Donald Sharp --- zebra/zebra_vty.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index df0e22b40c..ab7d2845e7 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -1766,9 +1766,11 @@ DEFPY (show_route, if (vrf_name) VRF_GET_ID(vrf_id, vrf_name, !!json); vrf = vrf_lookup_by_id(vrf_id); - if (vrf) - zvrf = vrf->info; - if (!vrf || !zvrf) + if (!vrf) + return CMD_SUCCESS; + + zvrf = vrf->info; + if (!zvrf) return CMD_SUCCESS; if (table_all)