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,
 };

 int __connman_timeserver_init(void)
--
1.9.1


Statement of Confidentiality

The contents of this e-mail message and any attachments are confidential and 
are intended solely for the addressee. The information may also be legally 
privileged. This transmission is sent in trust, and the sole purpose of 
delivery to the intended recipient. If you have received this transmission in 
error, any use, reproduction or dissemination of this transmission is strictly 
prohibited. If you are not the intended recipient, please immediately notify 
the sender by reply e-mail or at 508.683.2500 and delete this message and its 
attachments, if any.

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

Reply via email to