Lease seconds will not overflow, they are specified as a delta from
now to a point in the future. Therefore no truncation of the
received value is necessary.
---
gdhcp/client.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/gdhcp/client.c b/gdhcp/client.c
index 3c11957..f9cba89 100644
--- a/gdhcp/client.c
+++ b/gdhcp/client.c
@@ -1625,8 +1625,7 @@ static uint32_t get_lease(struct dhcp_packet *packet)
return 3600;
lease_seconds = get_be32(option);
- /* paranoia: must not be prone to overflows */
- lease_seconds &= 0x0fff;
+
if (lease_seconds < 10)
lease_seconds = 10;
--
2.1.4
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman