On Fri, Nov 15, 2019 at 12:22:11PM +0100, Vivien Henriet wrote:
After further testing and investigation, I found that my patch is not
fixing the issue.
I was testing it badly and concluded it too early that it was working.
I guess that you could revert this patch.
So let's resume the issue.
Problem: NTP server names are not resolved.
* have an interface up on a network without DHCP
* Wait for connman to assign a link local address
* start the DHCP server
* Wait for connman to get a new IP
At this point DNS request from timeserver.c are not sent anymore.
A speudo stack trace:
send() => return -1 with errno 22 (invalid parameter)
The send() fail because the socket was bind using the link local
configuration and was not reload
when ips were reconfigure using DHCP.
This issue was introduced in connman 1.37 with this commit:
cfd363a80ef22966c4042639c6770d70d0abc75a: timeserver: Do not start
several time server lookups
This patch makes the function __connman_timeserver_sync() avoid
reloading nameservers when the service
has not changed. But this will also ignore change on the same service
(dns added, ip change, ...).
I'm not sure how to fix properly the issue. And would like to have your
opinion before continuing on this issue.
Thanks for the explenation. cfd363a80ef2 ("timeserver: Do not start
several time server lookups") is fixing a real problem. We can only
handle one time server at a time. Anyway, that means the condition
when to trigger a new search for a time server needs to updated.
Currently the only condition __connman_timerserver_sync looks at is if
the default service has changed. So the simplest thing is propably to
pass down the reason why __connman_timeserver_sync() has been
called. Then you can add the logic in __connman_timeserver_sync() when
to restart the sync.