This could happen if the network routes are not yet setup
so the sendto() could fail. In this case try next address and
hope for the best. This is a rare issue but I have seen it
couple of times.
len = sendto(fd, &msg, sizeof(msg), MSG_DONTWAIT,
&addr, sizeof(addr));
if (len < 0) {
- connman_error("Time request for server %s failed", server);
+ connman_error("Time request for server %s failed (%d/%s)",
+ server, errno, strerror(errno));
+
+ if (errno == ENETUNREACH)
+ __connman_timeserver_sync_next();
+
return;
}