summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Dedecker <hans.dedecker@technicolor.com>2015-08-10 18:07:13 +0200
committerHans Dedecker <dedeckeh@gmail.com>2015-08-13 12:02:05 +0200
commit56b4e844baad6ea8eaaa6a4442583fa5ffa41bc7 (patch)
treeeb25cd903c66fa7c220f20f11a41f5d0b3a722a6
parent0ff39e3a124125914d2142d7127eab3a485ab34a (diff)
downloadodhcpd-56b4e844baad6ea8eaaa6a4442583fa5ffa41bc7.tar.gz
router: Fix compile issues
Fix compile issue due to comparison between signed and unsigned integers
-rw-r--r--src/dhcpv6-ia.c2
-rw-r--r--src/router.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/src/dhcpv6-ia.c b/src/dhcpv6-ia.c
index c5f8783..a4598df 100644
--- a/src/dhcpv6-ia.c
+++ b/src/dhcpv6-ia.c
@@ -572,7 +572,7 @@ void dhcpv6_ia_postupdate(struct interface *iface, time_t now)
int minprefix = -1;
for (size_t i = 0; i < iface->ia_addr_len; ++i) {
- if (iface->ia_addr[i].preferred > now &&
+ if (iface->ia_addr[i].preferred > (uint32_t)now &&
iface->ia_addr[i].prefix < 64 &&
iface->ia_addr[i].prefix > minprefix)
minprefix = iface->ia_addr[i].prefix;
diff --git a/src/router.c b/src/router.c
index 36f6ae7..1a008e1 100644
--- a/src/router.c
+++ b/src/router.c
@@ -269,7 +269,7 @@ static uint64_t send_router_advert(struct interface *iface, const struct in6_add
for (ssize_t i = 0; i < ipcnt; ++i) {
struct odhcpd_ipaddr *addr = &addrs[i];
- if (addr->prefix > 96 || addr->valid <= now)
+ if (addr->prefix > 96 || addr->valid <= (uint32_t)now)
continue; // Address not suitable
struct nd_opt_prefix_info *p = NULL;
@@ -287,7 +287,7 @@ static uint64_t send_router_advert(struct interface *iface, const struct in6_add
p = &adv.prefix[cnt++];
}
- if (addr->preferred > now &&
+ if (addr->preferred > (uint32_t)now &&
minvalid > 1000LL * (addr->valid - now))
minvalid = 1000LL * (addr->valid - now);
@@ -311,7 +311,7 @@ static uint64_t send_router_advert(struct interface *iface, const struct in6_add
if (iface->ra_advrouter)
p->nd_opt_pi_flags_reserved |= ND_OPT_PI_FLAG_RADDR;
p->nd_opt_pi_valid_time = htonl(addr->valid - now);
- if (addr->preferred > now)
+ if (addr->preferred > (uint32_t)now)
p->nd_opt_pi_preferred_time = htonl(addr->preferred - now);
@@ -392,7 +392,7 @@ static uint64_t send_router_advert(struct interface *iface, const struct in6_add
for (ssize_t i = 0; i < ipcnt; ++i) {
struct odhcpd_ipaddr *addr = &addrs[i];
- if (addr->dprefix > 64 || addr->dprefix == 0 || addr->valid <= now ||
+ if (addr->dprefix > 64 || addr->dprefix == 0 || addr->valid <= (uint32_t)now ||
(addr->dprefix == 64 && addr->prefix == 64)) {
continue; // Address not suitable
} else if (addr->dprefix > 32) {