summaryrefslogtreecommitdiff
path: root/gdhcp
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2015-10-08 16:39:41 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2015-10-19 13:01:59 +0300
commit44ade3714cbb185c8fc8b4fc787de7d17bd96049 (patch)
tree99ff877df5e4396ee5a0d2021a24fa670f74c2a4 /gdhcp
parentdb44dd5f029c0518d959aa08badcce3c35c89bf8 (diff)
downloadconnman-44ade3714cbb185c8fc8b4fc787de7d17bd96049.tar.gz
gdhcp: Remove unnecessary operation on lease seconds
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.
Diffstat (limited to 'gdhcp')
-rw-r--r--gdhcp/client.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/gdhcp/client.c b/gdhcp/client.c
index 3c11957c..f9cba894 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 &= 0x0fffffff;
+
if (lease_seconds < 10)
lease_seconds = 10;