summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2004-08-30 11:50:57 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2004-08-30 11:50:57 +0000
commit6f2212afec7bcf1e501f2e6913c9d27301119332 (patch)
treeac8ffd04e9be36bcaf69bf7e1ca79535a9c7b675 /usr.sbin
parent68ae73afd30ad43b46aee5bd20bf34897186d431 (diff)
ENOBUFS, EHOSTUNREACH, ENETDOWN and EHOSTDOWN are bad reasons to log; ok otto henning
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ntpd/ntp_msg.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/ntpd/ntp_msg.c b/usr.sbin/ntpd/ntp_msg.c
index 3217cfc977a..21013651654 100644
--- a/usr.sbin/ntpd/ntp_msg.c
+++ b/usr.sbin/ntpd/ntp_msg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntp_msg.c,v 1.5 2004/08/10 19:17:10 henning Exp $ */
+/* $OpenBSD: ntp_msg.c,v 1.6 2004/08/30 11:50:56 deraadt Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <errno.h>
#include "ntpd.h"
#include "ntp.h"
@@ -136,6 +137,11 @@ ntp_sendmsg(int fd, struct sockaddr *sa, struct ntp_msg *msg, ssize_t len,
}
if (sendto(fd, &buf, len, 0, sa, SA_LEN(sa)) != len) {
+ if (errno == ENOBUFS || errno == EHOSTUNREACH ||
+ errno == ENETDOWN || errno == EHOSTDOWN) {
+ /* logging is futile */
+ return (-1);
+ }
log_warn("sendto");
return (-1);
}