mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-06-11 00:50:12 +00:00
Merge pull request #2490 from pacovn/cppcheck_unsigned_check
babeld, eigrpd, ospfd: unsigned negative check (cppcheck, grouped)
This commit is contained in:
commit
162deb7dfb
@ -662,7 +662,7 @@ static int
|
||||
check_bucket(struct interface *ifp)
|
||||
{
|
||||
babel_interface_nfo *babel_ifp = babel_get_if_nfo(ifp);
|
||||
if(babel_ifp->bucket <= 0) {
|
||||
if(babel_ifp->bucket == 0) {
|
||||
int seconds = babel_now.tv_sec - babel_ifp->bucket_time;
|
||||
if(seconds > 0) {
|
||||
babel_ifp->bucket = MIN(BUCKET_TOKENS_MAX,
|
||||
|
@ -120,7 +120,7 @@ update_neighbour(struct neighbour *neigh, int hello, int hello_interval)
|
||||
int rc = 0;
|
||||
|
||||
if(hello < 0) {
|
||||
if(neigh->hello_interval <= 0)
|
||||
if(neigh->hello_interval == 0)
|
||||
return rc;
|
||||
missed_hellos =
|
||||
((int)timeval_minus_msec(&babel_now, &neigh->hello_time) -
|
||||
|
@ -573,7 +573,7 @@ static struct eigrp_neighbor *eigrpNbrLookup(struct variable *v, oid *name,
|
||||
first = 0;
|
||||
len = *length - v->namelen;
|
||||
|
||||
if (len <= 0)
|
||||
if (len == 0)
|
||||
first = 1;
|
||||
|
||||
if (len > IN_ADDR_SIZE)
|
||||
|
@ -1626,7 +1626,7 @@ static struct ospf_interface *ospfIfLookup(struct variable *v, oid *name,
|
||||
len = *length - v->namelen;
|
||||
if (len >= IN_ADDR_SIZE)
|
||||
len = IN_ADDR_SIZE;
|
||||
if (len <= 0)
|
||||
if (len == 0)
|
||||
ifaddr_next = 1;
|
||||
|
||||
oid2in_addr(name + v->namelen, len, ifaddr);
|
||||
@ -1990,7 +1990,7 @@ ospfVirtIfLookup(struct variable *v, oid *name, size_t *length,
|
||||
first = 0;
|
||||
|
||||
len = *length - v->namelen;
|
||||
if (len <= 0)
|
||||
if (len == 0)
|
||||
first = 1;
|
||||
if (len > IN_ADDR_SIZE)
|
||||
len = IN_ADDR_SIZE;
|
||||
@ -2176,7 +2176,7 @@ static struct ospf_neighbor *ospfNbrLookup(struct variable *v, oid *name,
|
||||
first = 0;
|
||||
len = *length - v->namelen;
|
||||
|
||||
if (len <= 0)
|
||||
if (len == 0)
|
||||
first = 1;
|
||||
|
||||
if (len > IN_ADDR_SIZE)
|
||||
|
Loading…
Reference in New Issue
Block a user