odhcpd_hexlify(duidbuf, c->clid_data, c->clid_len);
// iface DUID iaid hostname lifetime assigned length [addrs...]
- int l = snprintf(leasebuf, sizeof(leasebuf), "# %s %s %x %s %u %x %u ",
+ int l = snprintf(leasebuf, sizeof(leasebuf), "# %s %s %x %s %ld %x %u ",
iface->ifname, duidbuf, ntohl(c->iaid),
(c->hostname ? c->hostname : "-"),
- (unsigned)(c->valid_until > now ?
- (c->valid_until - now + wall_time) :
- (INFINITE_VALID(c->valid_until) ? INT32_MAX: 0)),
+ (c->valid_until > now ?
+ (c->valid_until - now + wall_time) :
+ (INFINITE_VALID(c->valid_until) ? -1 : 0)),
c->assigned, (unsigned)c->length);
struct in6_addr addr;
odhcpd_hexlify(duidbuf, c->hwaddr, sizeof(c->hwaddr));
// iface DUID iaid hostname lifetime assigned length [addrs...]
- int l = snprintf(leasebuf, sizeof(leasebuf), "# %s %s ipv4 %s %u %x 32 ",
+ int l = snprintf(leasebuf, sizeof(leasebuf), "# %s %s ipv4 %s %ld %x 32 ",
iface->ifname, duidbuf,
(c->hostname ? c->hostname : "-"),
- (unsigned)(c->valid_until > now ?
- (c->valid_until - now + wall_time) :
- (INFINITE_VALID(c->valid_until) ? INT32_MAX: 0)),
+ (c->valid_until > now ?
+ (c->valid_until - now + wall_time) :
+ (INFINITE_VALID(c->valid_until) ? -1 : 0)),
c->addr);
struct in_addr addr = {htonl(c->addr)};
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);
}
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);
}