Skip to content

Commit

Permalink
bgpd: Clean up issues found in SA with clang 14
Browse files Browse the repository at this point in the history
3 different issues:

a) length never used
b) safi never used
c) length never used.

Signed-off-by: Donald Sharp <[email protected]>
  • Loading branch information
donaldsharp committed Jan 9, 2024
1 parent 22b4390 commit e92a7e9
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions bgpd/bgp_snmp_bgp4v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,6 @@ bgp4v2PathAttrLookup(struct variable *v, oid name[], size_t *length,
struct bgp_path_info *path, *min;
struct bgp_dest *dest;
union sockunion su;
unsigned int len;
struct ipaddr paddr = {};
size_t namelen = v ? v->namelen : BGP4V2_NLRI_ENTRY_OFFSET;
sa_family_t family;
Expand Down Expand Up @@ -544,11 +543,9 @@ bgp4v2PathAttrLookup(struct variable *v, oid name[], size_t *length,
/* Set OID offset for prefix type */
offset = name + namelen;
offsetlen = *length - namelen;
len = offsetlen;

if (offsetlen == 0) {
dest = bgp_table_top(bgp->rib[afi][SAFI_UNICAST]);
safi = SAFI_UNICAST;
} else {

/* bgp4V2NlriAfi is already get */
Expand Down Expand Up @@ -595,11 +592,6 @@ bgp4v2PathAttrLookup(struct variable *v, oid name[], size_t *length,
return NULL;

if (offsetlen > 0) {
len = offsetlen;
if (len > afi_len)
len = afi_len;


/* get bgp4V2PeerRemoteAddrType */
peer_addr_type = *offset;
if (peer_addr_type == IANA_AFI_IPV4)
Expand Down

0 comments on commit e92a7e9

Please sign in to comment.