On Thu, 2015-04-30 at 18:53 -0700, Adam Moore wrote:
> Upon an ipconfig change of the default service, resync
> with timeservers.
> ---
>  src/timeserver.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/src/timeserver.c b/src/timeserver.c
> index f0d33e5..f76320c 100644
> --- a/src/timeserver.c
> +++ b/src/timeserver.c
> @@ -417,9 +417,25 @@ static void default_changed(struct connman_service 
> *default_service)
>                 timeserver_stop();
>  }
> 
> +static void ipconfig_changed(struct connman_service *service,
> +                               struct connman_ipconfig *ipconfig)
> +{
> +       /* if default service changed, resync timeservers */
> +       if (service) {
> +               if(service != __connman_service_get_default()) {
> +                       return;
> +               }
> +
> +               timeserver_start(service);
> +       } else {
> +               timeserver_stop();
> +       }
> +}
> +
>  static struct connman_notifier timeserver_notifier = {
>         .name                   = "timeserver",
>         .default_changed        = default_changed,
> +       .ipconfig_changed       = ipconfig_changed,

This function is called when an IP configuration changes. As there is no
socket open to the timeserver, the next time a timeserver is contacted
the new IP address will be used. Which version/commit of ConnMan was
used for this patch?

When the default service is changed from one service to another, that is
handled as before with the 'default_changed' function.

>  };
> 
>  int __connman_timeserver_init(void)
> --
> 1.9.1

Cheers,

        Patrik

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

Reply via email to