From 44ade3714cbb185c8fc8b4fc787de7d17bd96049 Mon Sep 17 00:00:00 2001 From: Patrik Flykt Date: Thu, 8 Oct 2015 16:39:41 +0300 Subject: 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. --- gdhcp/client.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'gdhcp') 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; -- cgit v1.2.1