From c17140fd7aff77c1763333dfdbc2bb0cf162786c Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 3 Oct 2019 08:55:29 -0400 Subject: [PATCH 1/2] bgpd: Show to compiler that uint64_t -> uint32_t is ok here We only have a uint32_t value here but clippy is wise and gives us more data than we need. Tell the compiler we can throw some stuff away. This was found by inspecting CI results. Signed-off-by: Donald Sharp --- bgpd/bgp_rpki.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bgpd/bgp_rpki.c b/bgpd/bgp_rpki.c index 352e3b87e8..1267e35097 100644 --- a/bgpd/bgp_rpki.c +++ b/bgpd/bgp_rpki.c @@ -1234,7 +1234,8 @@ DEFPY (show_rpki_prefix, const struct pfx_record *record = &matches[i]; if (record->max_len >= prefix->prefixlen - && ((asn != 0 && asn == record->asn) || asn == 0)) { + && ((asn != 0 && (uint32_t)asn == record->asn) + || asn == 0)) { print_record(&matches[i], vty); } } From 3835984f1c66283031af6c3433ff6e289b6059a6 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 3 Oct 2019 08:57:55 -0400 Subject: [PATCH 2/2] bgpd: bgp pointer may be null The bgp pointer may not be actually found. The debug message that was using it could get the same value another way. Convert over Fixes Coverity Scan Issue: Signed-off-by: Donald Sharp --- bgpd/bgp_zebra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index de39e295ff..8970e9d1d1 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -209,7 +209,7 @@ static int bgp_ifp_destroy(struct interface *ifp) bgp = bgp_lookup_by_vrf_id(ifp->vrf_id); if (BGP_DEBUG(zebra, ZEBRA)) - zlog_debug("Rx Intf del VRF %u IF %s", bgp->vrf_id, ifp->name); + zlog_debug("Rx Intf del VRF %u IF %s", ifp->vrf_id, ifp->name); if (bgp) bgp_update_interface_nbrs(bgp, ifp, NULL);