Re: [PATCH] gdhcp: Remove unnecessary operation on lease seconds

2015-10-19 Thread Patrik Flykt
On Thu, 2015-10-08 at 16:39 +0300, Patrik Flykt wrote:
> 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.

Applied.

Patrik

___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


[PATCH] gdhcp: Remove unnecessary operation on lease seconds

2015-10-08 Thread Patrik Flykt
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