diff options
author | Jukka Rissanen <jukka.rissanen@linux.intel.com> | 2012-07-16 11:00:46 +0300 |
---|---|---|
committer | Daniel Wagner <daniel.wagner@bmw-carit.de> | 2012-07-16 18:03:29 +0200 |
commit | e91159d7cea8c5d7a7eadb337233c3d2e32b9bfe (patch) | |
tree | 1052d011bd4bac3e3cf30d0f28c94b1db335530c | |
parent | fc98abda2a78879285c953d9091b444b04776ba9 (diff) | |
download | connman-e91159d7cea8c5d7a7eadb337233c3d2e32b9bfe.tar.gz connman-e91159d7cea8c5d7a7eadb337233c3d2e32b9bfe.tar.bz2 connman-e91159d7cea8c5d7a7eadb337233c3d2e32b9bfe.zip |
ntp: If the server cannot be contacted, try next one
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.
-rw-r--r-- | src/ntp.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -100,7 +100,12 @@ static void send_packet(int fd, const char *server) 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; } |