summaryrefslogtreecommitdiffhomepage
path: root/src/ubus.c
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2016-11-21 14:42:16 +0100
committerFelix Fietkau <nbd@nbd.name>2016-12-01 11:27:15 +0100
commit01c919c49ccbc8ded444f7eedc1db04aa2fa2f9b (patch)
treeb523aabd5d5a235e6785d7c4fa8b0c64e71d735e /src/ubus.c
parent5f425ed1e5f92397e27ec4f44820b6ef677b8134 (diff)
odhcpd: Display infinite valid lifetime as -1
Display infinite valid lifetime as -1 both in ubus and statefile Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src/ubus.c')
-rw-r--r--src/ubus.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ubus.c b/src/ubus.c
index 425abe4..e9e2de3 100644
--- a/src/ubus.c
+++ b/src/ubus.c
@@ -51,7 +51,7 @@ static int handle_dhcpv4_leases(struct ubus_context *ctx, _unused struct ubus_ob
blobmsg_add_string_buffer(&b);
blobmsg_add_u32(&b, "valid", INFINITE_VALID(lease->valid_until) ?
- INT32_MAX : (uint32_t)(lease->valid_until - now));
+ (uint32_t)-1 : (uint32_t)(lease->valid_until - now));
blobmsg_close_table(&b, l);
}
@@ -117,7 +117,7 @@ static int handle_dhcpv6_leases(_unused struct ubus_context *ctx, _unused struct
blobmsg_close_table(&b, m);
blobmsg_add_u32(&b, "valid", INFINITE_VALID(lease->valid_until) ?
- INT32_MAX : (uint32_t)(lease->valid_until - now));
+ (uint32_t)-1 : (uint32_t)(lease->valid_until - now));
blobmsg_close_table(&b, l);
}