summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2016-07-14 14:52:13 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2016-07-15 13:31:31 +0300
commit79664f0a4107d3f4e201822761460f2e6fabd6bf (patch)
tree7bf546a15d49daceb4e1e7d9eeb59cb345b0b522
parent2449a46de047cfc8f093a0238a886be81f0f68ae (diff)
downloadconnman-79664f0a4107d3f4e201822761460f2e6fabd6bf.tar.gz
dhcpv6: Return -EISCONN when the expiry time is inifinite
When the expiry time for an DHCPv6 address is infinite, no renewals are needed. Return -EISCONN to notify the callers of this function that no timeouts need to be set up. Based on a patch by wangfe@nestlabs.com
-rw-r--r--src/dhcpv6.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/dhcpv6.c b/src/dhcpv6.c
index 9e210403..1bd00009 100644
--- a/src/dhcpv6.c
+++ b/src/dhcpv6.c
@@ -1193,6 +1193,11 @@ static int check_restart(struct connman_dhcpv6 *dhcp)
g_dhcpv6_client_get_timeouts(dhcp->dhcp_client, NULL, NULL,
NULL, &expired);
+
+ /* infinite lifetime for an DHCPv6 address */
+ if (expired == 0xffffffff)
+ return -EISCONN;
+
current = time(NULL);
if (current >= expired) {