]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Don't log network is unreachable errors
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 27 Apr 2010 13:56:48 +0000 (15:56 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 27 Apr 2010 13:56:48 +0000 (15:56 +0200)
ntp_io.c

index 7ccc459049d3909e5422c9f1cf968bf5913f0318..3fbc642d3a10f707022b3e3cb3d8899d663fd1e0 100644 (file)
--- a/ntp_io.c
+++ b/ntp_io.c
@@ -454,7 +454,14 @@ send_packet(void *packet, int packetlen, NTP_Remote_Address *remote_addr)
   if (!cmsglen)
     msg.msg_control = NULL;
 
-  if (sendmsg(sock_fd, &msg, 0) < 0 && !LOG_RateLimited()) {
+  if (sendmsg(sock_fd, &msg, 0) < 0 &&
+#ifdef ENETUNREACH
+      errno != ENETUNREACH &&
+#endif
+#ifdef ENETDOWN
+      errno != ENETDOWN &&
+#endif
+      !LOG_RateLimited()) {
     LOG(LOGS_WARN, LOGF_NtpIO, "Could not send to %s:%d : %s",
         UTI_IPToString(&remote_addr->ip_addr), remote_addr->port, strerror(errno));
   }