Send connman mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.01.org/mailman/listinfo/connman
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."


Today's Topics:

   1. [PATCH] dhcpv6: use correct dhcp renew time when valid
      life-time is infinity. (Feng Wang)
   2. Re: connman-vpnd does not reconnect after resume (Vasiliy Tolstov)


----------------------------------------------------------------------

Message: 1
Date: Wed, 25 May 2016 14:37:14 -0700
From: Feng Wang <[email protected]>
To: [email protected]
Subject: [PATCH] dhcpv6: use correct dhcp renew time when valid
        life-time is infinity.
Message-ID: <[email protected]>

Based on RFC 3315, 22.6, the valid life-time is infinite when its
value is 0xffffffff. In the g_dhcpv6_client_get_timeouts, the expire
data type is time_t. If time_t is uint32, the last_request time plus
0xffffffff will wrapover so that expire time is smaller than current
time. Thus the dhcpv6 will restart immediately(dhcpv6_restart called).
---
 gdhcp/client.c |  9 +++++++--
 src/dhcpv6.c   | 12 +++++++++---
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/gdhcp/client.c b/gdhcp/client.c
index 9012b38..2be3982 100644
--- a/gdhcp/client.c
+++ b/gdhcp/client.c
@@ -835,8 +835,13 @@ int g_dhcpv6_client_get_timeouts(GDHCPClient *dhcp_client,
        if (started)
                *started = dhcp_client->last_request;
 
-       if (expire)
-               *expire = dhcp_client->last_request + dhcp_client->expire;
+       if (expire) {
+               if (dhcp_client->expire == 0xffffffff)
+                       /* RFC3315 22.6 infinite valid-lifetime */
+                       *expire = 0xffffffff;
+               else
+                       *expire = dhcp_client->last_request + 
dhcp_client->expire;
+       }
 
        return 0;
 }
diff --git a/src/dhcpv6.c b/src/dhcpv6.c
index 9e21040..abbc1bf 100644
--- a/src/dhcpv6.c
+++ b/src/dhcpv6.c
@@ -1195,7 +1195,7 @@ static int check_restart(struct connman_dhcpv6 *dhcp)
                                NULL, &expired);
        current = time(NULL);
 
-       if (current >= expired) {
+       if (current >= expired && expired != 0xffffffff) {
                DBG("expired by %d secs", (int)(current - expired));
 
                g_timeout_add(0, dhcpv6_restart, dhcp);
@@ -1442,8 +1442,14 @@ int __connman_dhcpv6_start_renew(struct connman_network 
*network,
                /* RFC 3315, 22.4
                 * Client can choose the timeout.
                 */
-               T1 = (expired - started) / 2;
-               T2 = (expired - started) / 10 * 8;
+               if (expired == 0xffffffff) {
+                   /* RFC 3315, 22.6 infinite valid-lifetime */
+                   T1 = 0xffffffff / 2;
+                   T2 = 0xffffffff/ 10 * 8;
+               } else {
+                   T1 = (expired - started) / 2;
+                   T2 = (expired - started) / 10 * 8;
+               }
        }
 
        dhcp->callback = callback;
-- 
2.8.0.rc3.226.g39d4020



------------------------------

Message: 2
Date: Thu, 26 May 2016 14:42:15 +0300
From: Vasiliy Tolstov <[email protected]>
To: ??????? ??????? <[email protected]>
Cc: connman <[email protected]>
Subject: Re: connman-vpnd does not reconnect after resume
Message-ID:
        <CACaajQvqMriZb6CBKA0gzmv_5yE=bojzwu3h06dhmnjbbck...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Ping?
11 ??? 2016 ?. 14:53 ???????????? "Vasiliy Tolstov" <[email protected]>
???????:

> 2016-05-07 23:21 GMT+03:00 Vasiliy Tolstov <[email protected]>:
> > I'm build latest connman 1.32 and connman vpn plugin.
> > After lid closed my laptop suspended to ram. After resume connman
> > succeseful reconnect to my wifi, but vpn connection not reconnected.
>
> I'm recheck, vpn connection established only when i manually do
> connmanctl connect
>
> --
> Vasiliy Tolstov,
> e-mail: [email protected]
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.01.org/pipermail/connman/attachments/20160526/b7613ec1/attachment-0001.html>

------------------------------

Subject: Digest Footer

_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman


------------------------------

End of connman Digest, Vol 7, Issue 14
**************************************

Reply via email to