On Tue, 2014-04-08 at 08:51 +0200, Tim Sander wrote:
> Hi Patrik and list
> > On Thu, 2014-04-03 at 15:35 +0200, Tim Sander wrote:
> > > I currently have a connman 1.22 set up with time TimeUpdates set to
> > > manual. This is due to the fact that i use ntpd for time
> > > synchronisation due to the better accuracy.
If there is anything in the accuracy calculation itself, please send
patches. Currently we're fine with SNTP using one NTP server at a time,
if it's this part that causes most of the inaccuracy there's
unfortunately not much that can be done.
> Well how should that be done if the DHCP Information is nowhere availabe. I
> guess NTP Timeservers is a common Information delivered via dhcp.
Service Timeservers property is not the best choice here as its defined
as containing the timeservers being used by ConnMan.
> The following patch should disable the ntp functionality but still display
> the
> information in the normal locations. I have this gut feeling that this patch
> might not be acceptable for mainline. As its not clear if the ntp server is
> active or not. But it would be nice to have the DHCP information exposed on
> the DBUS somewhere.
> --- connman-1.22/src/timeserver.c.orig 2014-04-04 12:09:27.650024757 +0200
> +++ connman-1.22/src/timeserver.c 2014-04-04 12:15:38.324309664 +0200
> @@ -187,9 +187,6 @@
> char **fallback_ts;
> int index, i;
>
> - if (__connman_clock_timeupdates() == TIME_UPDATES_MANUAL)
> - return NULL;
> -
This function is called from multiple places, not only when updating
service properties. If this function returns something non-NULL - which
it does after the above change - the other parts of the code will make
ConnMan believe it is to handle NTP...
> service_ts_config = connman_service_get_timeservers_config(service);
>
> /* First add Service Timeservers.Configuration to the list */
> @@ -366,8 +363,9 @@
> if (getenv("CONNMAN_RESOLV_DEBUG"))
> g_resolv_set_debug(resolv, resolv_debug, "RESOLV");
>
> - for (i = 0; nameservers[i]; i++)
> - g_resolv_add_nameserver(resolv, nameservers[i], 53, 0);
> + if (__connman_clock_timeupdates() != TIME_UPDATES_MANUAL)
> + for (i = 0; nameservers[i]; i++)
> + g_resolv_add_nameserver(resolv, nameservers[i], 53,
> 0);
This part prevents only DNS lookups, if the timeservers are specified
using IP addresses, they are used and ConnMan happily does the NTP part
itself. DHCP always gives NTP servers as IP addresses...
> g_strfreev(nameservers);
Cheers,
Patrik
_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman