Hi,

On Thu, 2014-09-11 at 01:03 +0300, [email protected] wrote:
> From: Pasi Sjöholm <[email protected]>
> 
> 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
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to