RE: [PATCH 1/2] dhcpv6: Do not let rebind and renew go crazy due too low T1 and T2

2014-09-11 Thread Pasi Sjöholm
>This problem does not actually exist. RFC 3315 says "In a message sent
>by a server to a client, the client MUST use the values in the T1 and T2
>fields for the T1 and T2 parameters..." unless they are zero.

Yes, this patch can be dropped. No need for it really..

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


Re: [PATCH 1/2] dhcpv6: Do not let rebind and renew go crazy due too low T1 and T2

2014-09-11 Thread Patrik Flykt
On Thu, 2014-09-11 at 10:15 +0300, Patrik Flykt wrote:
> The second problem is that ConnMan needs to keep in mind also T2 and
> address expiry values. By only checking against T1 it is possible to
> construct a case where the server sets T1 to 5 seconds, T2 to 7
> seconds and address expiry to 9 seconds. That means the address
> expires from the server before ConnMan even gets to T1. Thus the check
> should be done with expiry time in mind, and expiry should be checked
> that it is greater than T2.

This problem does not actually exist. RFC 3315 says "In a message sent
by a server to a client, the client MUST use the values in the T1 and T2
fields for the T1 and T2 parameters..." unless they are zero.

Cheers,

Patrik


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


Re: [PATCH 1/2] dhcpv6: Do not let rebind and renew go crazy due too low T1 and T2

2014-09-11 Thread Patrik Flykt

Hi,

On Thu, 2014-09-11 at 01:03 +0300, pasi.sjoh...@jolla.com wrote:
> From: Pasi Sjöholm 
> 
> Force minimum T1 and T2 to prevent renew and rebind go grazy if
> the lease is not getting renew or rebound.
> ---
>  src/dhcpv6.c | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/src/dhcpv6.c b/src/dhcpv6.c
> index a1a6e92..00dba3a 100644
> --- a/src/dhcpv6.c
> +++ b/src/dhcpv6.c
> @@ -1428,6 +1428,11 @@ int __connman_dhcpv6_start_renew(struct 
> connman_network *network,
>*/
>   T1 = (expired - started) / 2;
>   T2 = (expired - started) / 10 * 8;
> +
> + if (T1 < 10) {
> + T1 = 10;
> + T2 = 16;
> + }
>   }

First of all, this check needs to be done on all values of T1, T2, not
only the ones ConnMan computes in response to them being zero.

The second problem is that ConnMan needs to keep in mind also T2 and
address expiry values. By only checking against T1 it is possible to
construct a case where the server sets T1 to 5 seconds, T2 to 7 seconds
and address expiry to 9 seconds. That means the address expires from the
server before ConnMan even gets to T1. Thus the check should be done
with expiry time in mind, and expiry should be checked that it is
greater than T2.

Cheers,

Patrik


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