]> git.puffer.fish Git - matthieu/frr.git/commitdiff
babeld, eigrpd, ospfd: unsigned negative check
authorpaco <paco@voltanet.io>
Mon, 18 Jun 2018 17:07:24 +0000 (19:07 +0200)
committerpaco <paco@voltanet.io>
Mon, 18 Jun 2018 17:07:24 +0000 (19:07 +0200)
After Cppcheck 1.72 feedback

Signed-off-by: F. Aragon <paco@voltanet.io>
babeld/message.c
babeld/neighbour.c
eigrpd/eigrp_snmp.c
ospfd/ospf_snmp.c

index 1ff4867908cf19a134f291564d9fc112c3b3633e..95b4e87cc7e64b487a00aca8c5a3f96a754ade99 100644 (file)
@@ -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,
index 48a32c4a9c39c658d86ee6564958475685ed20cf..3db121fd263ea9114cb84ffcdef7fe3b602790f5 100644 (file)
@@ -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) -
index 7dd95b7bc6c860177b8d3dc0209fca72be2efa9e..1a6dee681f4a614a7b0702af2537c7b7505f25e8 100644 (file)
@@ -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)
index 6825be83ac89b007078e9ee369690c771f2d34ec..c90db031dcf2f2137687d2cf81da53bc8e122980 100644 (file)
@@ -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)