summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpaco <paco@voltanet.io>2018-06-18 19:07:24 +0200
committerpaco <paco@voltanet.io>2018-06-18 19:07:24 +0200
commitd11c6941dc5e3663891e61a4e24f94b4d0e6bd68 (patch)
treeebbd6ab6492b790eb742d0bf1ff9d8b98b862d92
parent36de1d53b87eccb7f6ceaf12f74a55981c35b9b7 (diff)
babeld, eigrpd, ospfd: unsigned negative check
After Cppcheck 1.72 feedback Signed-off-by: F. Aragon <paco@voltanet.io>
-rw-r--r--babeld/message.c2
-rw-r--r--babeld/neighbour.c2
-rw-r--r--eigrpd/eigrp_snmp.c2
-rw-r--r--ospfd/ospf_snmp.c6
4 files changed, 6 insertions, 6 deletions
diff --git a/babeld/message.c b/babeld/message.c
index 1ff4867908..95b4e87cc7 100644
--- a/babeld/message.c
+++ b/babeld/message.c
@@ -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,
diff --git a/babeld/neighbour.c b/babeld/neighbour.c
index 48a32c4a9c..3db121fd26 100644
--- a/babeld/neighbour.c
+++ b/babeld/neighbour.c
@@ -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) -
diff --git a/eigrpd/eigrp_snmp.c b/eigrpd/eigrp_snmp.c
index 7dd95b7bc6..1a6dee681f 100644
--- a/eigrpd/eigrp_snmp.c
+++ b/eigrpd/eigrp_snmp.c
@@ -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)
diff --git a/ospfd/ospf_snmp.c b/ospfd/ospf_snmp.c
index 6825be83ac..c90db031dc 100644
--- a/ospfd/ospf_snmp.c
+++ b/ospfd/ospf_snmp.c
@@ -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)