Send connman mailing list submissions to
        connman@lists.01.org

To subscribe or unsubscribe via email, send a message with subject or
body 'help' to
        connman-requ...@lists.01.org

You can reach the person managing the list at
        connman-ow...@lists.01.org

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

Today's Topics:

   1. Re: [PATCH] service: Restart online chek after connection loss
      (Daniel Wagner)
   2. Re: [PATCH 1/2] service: Add online check interval config options
      (Daniel Wagner)
   3. Re: [PATCH 2/2] wispr: Update service state on connection loss
      (Daniel Wagner)
   4. Re: [PATCH v3] clock: Add TimeSynced signal emitted when the system time 
has been synced
      (Daniel Wagner)
   5. RE: [PATCH 2/2] wispr: Update service state on connection loss
      (VAUTRIN Emmanuel (Canal Plus Prestataire))
   6. Re: [PATCH] timeserver: Reset synchro on system timeserver update
      (Daniel Wagner)
   7. Re: [PATCH] timeserver: Fix time update manual->auto at startup
      (Daniel Wagner)


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

Date: Fri, 5 Feb 2021 09:02:01 +0100
From: Daniel Wagner <w...@monom.org>
Subject: Re: [PATCH] service: Restart online chek after connection
        loss
To: "VAUTRIN Emmanuel (Canal Plus Prestataire)"
        <emmanuel.vaut...@cpexterne.org>
Cc: "connman@lists.01.org" <connman@lists.01.org>
Message-ID: <20210205080201.nofhnjlb744yc...@beryllium.lan>
Content-Type: text/plain; charset=us-ascii

On Tue, Feb 02, 2021 at 02:09:20PM +0000, VAUTRIN Emmanuel (Canal Plus 
Prestataire) wrote:
> After a connection loss, the online check needs to be restarted
> on the new default service, if ready, to get online, in replacement.
> ---
>  src/service.c | 23 +++++++++++------------
>  1 file changed, 11 insertions(+), 12 deletions(-)
> 
> diff --git a/src/service.c b/src/service.c
> index c9bcad16..b33310b6 100644
> --- a/src/service.c
> +++ b/src/service.c
> @@ -1586,6 +1587,16 @@ connman_info("%s(%d) -------------------------- 
> services %p %s, state: %d -> %p
>                               
> connman_setting_get_bool("AllowDomainnameUpdates"))
>                       __connman_utsname_set_domainname(service->domainname);
>  
> +             if (__connman_service_is_connected_state(service,
> +                                             CONNMAN_IPCONFIG_TYPE_IPV4))
> +                     __connman_service_wispr_start(service,
> +                                             CONNMAN_IPCONFIG_TYPE_IPV4);
> +
> +             if (__connman_service_is_connected_state(service,
> +                                             CONNMAN_IPCONFIG_TYPE_IPV6))
> +                     __connman_service_wispr_start(service,
> +                                             CONNMAN_IPCONFIG_TYPE_IPV6);
> +

default_changed() is the wrong place for such code.

WISPr should be restarted when the online check fails, the IP
configuration changes via D-Bus or a new IP set:

__connman_service_online_check_failed
  redo_wispr_ipv4
  redo_wispr_ipv6
    redo_wispr
      __connman_wispr_start

__connman_service_reset_ipconfig
  address_updated
    start_online_check

service_ip_bound
  address_updated
    start_online_check

So the last call chain should handle the situation you describe.

Thanks,
Daniel

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

Date: Fri, 5 Feb 2021 09:24:22 +0100
From: Daniel Wagner <w...@monom.org>
Subject: Re: [PATCH 1/2] service: Add online check interval config
        options
To: "VAUTRIN Emmanuel (Canal Plus Prestataire)"
        <emmanuel.vaut...@cpexterne.org>
Cc: "connman@lists.01.org" <connman@lists.01.org>
Message-ID: <20210205082422.g6nmm2oyzqsh7...@beryllium.lan>
Content-Type: text/plain; charset=us-ascii

Hi Emmanuel,

On Tue, Feb 02, 2021 at 05:44:55PM +0000, VAUTRIN Emmanuel (Canal Plus 
Prestataire) wrote:
> Global config options, which allow to set initial and maximum intervals
> between two online check requests.
> The interval will increase by power of two, from
> OnlineCheckInitialInterval (1 second by default) to
> OnlineCheckMaxInterval (144 seconds by default).

Overall these patch looks pretty good. Just a few nitpicks.

> +unsigned int connman_setting_get_uint(const char *key)
> +{
> +     if (g_str_equal(key, CONF_ONLINE_CHECK_INITIAL_INTERVAL))
> +             return connman_settings.online_check_initial_interval;
> +
> +     if (g_str_equal(key, CONF_ONLINE_CHECK_MAX_INTERVAL))
> +             return connman_settings.online_check_max_interval;
> +
> +     return NULL;
> +}

return 0;

> diff --git a/src/main.conf b/src/main.conf
> index 14965e12c300..f8a3da526b91 100644
> --- a/src/main.conf
> +++ b/src/main.conf
> @@ -125,6 +125,22 @@
>  # Default value is true.
>  # EnableOnlineCheck = false
> 
> +# Set initial interval between two online check requests.
> +# The interval will increase by power of two from OnlineCheckInitialInterval
> +# to OnlineCheckMaxInterval.
> +# Default is 1, corresponding to 1 second.
> +# Use this setting to increase the value in case of different user
> +# interface designs.
> +# OnlineCheckInitialInterval = 1
> +
> +# Set maximum interval between two online check requests.
> +# The interval will increase by power of two from OnlineCheckInitialInterval
> +# to OnlineCheckMaxInterval.
> +# Default is 12, corresponding to 144 seconds.
> +# Use this setting to decrease the value in case of different user
> +# interface designs.
> +# OnlineCheckMaxInterval = 12

I'd say 'Use this setting to decrease...' is not really explaining, it's
too terse. What about dropping these sentences and add an explanation in
the man pages what you can do with those values?


> @@ -458,6 +474,20 @@ static void parse_config(GKeyFile *config)
> 
>         g_clear_error(&error);
> 
> +       integer = g_key_file_get_integer(config, "General",
> +                       CONF_ONLINE_CHECK_INITIAL_INTERVAL, &error);
> +       if (!error && integer >= 1)
> +               connman_settings.online_check_initial_interval = integer;
> +
> +       g_clear_error(&error);
> +
> +       integer = g_key_file_get_integer(config, "General",
> +                       CONF_ONLINE_CHECK_MAX_INTERVAL, &error);
> +       if (!error && integer >= 
> connman_settings.online_check_initial_interval)
> +               connman_settings.online_check_max_interval = integer;
> +
> +       g_clear_error(&error);

The checks look reasonable but if you really want to be sure the
provided numbers make sense you need to parse both values first and then
do a final range check:

    1 <= initial_interval < max_interval

because currently I could set the initial_interval > max_interval by not
providing the max interval.

Thanks,
Daniel

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

Date: Fri, 5 Feb 2021 09:32:12 +0100
From: Daniel Wagner <w...@monom.org>
Subject: Re: [PATCH 2/2] wispr: Update service state on connection
        loss
To: "VAUTRIN Emmanuel (Canal Plus Prestataire)"
        <emmanuel.vaut...@cpexterne.org>
Cc: "connman@lists.01.org" <connman@lists.01.org>
Message-ID: <20210205083212.recucq75onldn...@beryllium.lan>
Content-Type: text/plain; charset=us-ascii

Hi Emmanuel,

On Tue, Feb 02, 2021 at 05:50:22PM +0000, VAUTRIN Emmanuel (Canal Plus 
Prestataire) wrote:
> Keep checking Internet connection availability when online, and update
> the service state to ready on connection loss.

If the connection is dropped ConnMan should go through the state
transition from read/online to failure/error to idle. Then the normal
reconnect algorithm should kick in. Or what do you mean with connection
loss?

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

Date: Fri, 5 Feb 2021 09:36:45 +0100
From: Daniel Wagner <w...@monom.org>
Subject: Re: [PATCH v3] clock: Add TimeSynced signal emitted when the
        system time has been synced
To: "VAUTRIN Emmanuel (Canal Plus Prestataire)"
        <emmanuel.vaut...@cpexterne.org>
Cc: "connman@lists.01.org" <connman@lists.01.org>
Message-ID: <20210205083645.jw72q4w2jsqre...@beryllium.lan>
Content-Type: text/plain; charset=us-ascii

Hi Emmanuel,

On Wed, Feb 03, 2021 at 09:51:50AM +0000, VAUTRIN Emmanuel (Canal Plus 
Prestataire) wrote:
> Implement Clock API TimeserverSynced property, which indicates if the
> current system time is synced via NTP servers.
> Trigger a time synchronization when the TimeUpdate property is set to
> auto.
> Emit a Time PropertyChanged signal on NTP synchronization success.

Patch applied.

Thanks,
Daniel

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

Date: Fri, 5 Feb 2021 08:37:28 +0000
From: "VAUTRIN Emmanuel (Canal Plus Prestataire)"
        <emmanuel.vaut...@cpexterne.org>
Subject: RE: [PATCH 2/2] wispr: Update service state on connection
        loss
To: Daniel Wagner <w...@monom.org>
Cc: "connman@lists.01.org" <connman@lists.01.org>
Message-ID:  <pr1pr02mb479459ce04b9fc07c259707b93...@pr1pr02mb4794.eur
        prd02.prod.outlook.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi Daniel,

> If the connection is dropped ConnMan should go through the state
> transition from read/online to failure/error to idle. Then the normal
> reconnect algorithm should kick in. Or what do you mean with connection
> loss?
My meaning was no more Internet connection, connected but offline, instead of 
disconnected.

B.R.

Emmanuel

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

Date: Fri, 5 Feb 2021 09:45:49 +0100
From: Daniel Wagner <w...@monom.org>
Subject: Re: [PATCH] timeserver: Reset synchro on system timeserver
        update
To: "VAUTRIN Emmanuel (Canal Plus Prestataire)"
        <emmanuel.vaut...@cpexterne.org>
Cc: "connman@lists.01.org" <connman@lists.01.org>
Message-ID: <20210205084549.qmqdiimxp5zs2...@beryllium.lan>
Content-Type: text/plain; charset=us-ascii

Hi Emmanuel,

On Wed, Feb 03, 2021 at 01:04:11PM +0000, VAUTRIN Emmanuel (Canal Plus 
Prestataire) wrote:
> It is necessary to reset time synchronization when system timeserver
> configuration is updated, moreover when it is not available via current
> service (no timeserver, no responses...).

Ah, so when the default service which is already in use gets a
configuration change, it was not updated because in
__connman_timeserver_conf_udpate() we check if the service has changed
or not.

Alright I'm apply thing this patch but adding a 'if (service)' as
connman_service_get_default() can return NULL. 

Thanks,
Daniel

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

Date: Fri, 5 Feb 2021 09:53:46 +0100
From: Daniel Wagner <w...@monom.org>
Subject: Re: [PATCH] timeserver: Fix time update manual->auto at
        startup
To: "VAUTRIN Emmanuel (Canal Plus Prestataire)"
        <emmanuel.vaut...@cpexterne.org>
Cc: "connman@lists.01.org" <connman@lists.01.org>
Message-ID: <20210205085346.baoh4szsfkyuf...@beryllium.lan>
Content-Type: text/plain; charset=us-ascii

Hi Emmanuel,

On Wed, Feb 03, 2021 at 03:36:42PM +0000, VAUTRIN Emmanuel (Canal Plus 
Prestataire) wrote:
> When resetting the time synchronization, always set the associated
> service, even when the timeserver list is empty, to enable future
> synchronization, when switching time update from manual to auto.

Thanks for the explanation. In this case I think we should do just

        if (!timeservers_list) {
                DBG("No timeservers set.");
                ts_service = NULL;
                return;
        }

Wouldn't this be enough?

Thanks,
Daniel

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

Subject: Digest Footer

_______________________________________________
connman mailing list -- connman@lists.01.org
To unsubscribe send an email to connman-le...@lists.01.org


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

End of connman Digest, Vol 64, Issue 4
**************************************

Reply via email to