From f66c7f640441a663f11c4bdea57d021b935e53d1 Mon Sep 17 00:00:00 2001 From: deraadt <> Date: Mon, 30 Aug 2004 11:50:56 +0000 Subject: [PATCH] ENOBUFS, EHOSTUNREACH, ENETDOWN and EHOSTDOWN are bad reasons to log; ok otto henning --- src/usr.sbin/ntpd/ntp_msg.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/usr.sbin/ntpd/ntp_msg.c b/src/usr.sbin/ntpd/ntp_msg.c index 3217cfc9..21013651 100644 --- a/src/usr.sbin/ntpd/ntp_msg.c +++ b/src/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 @@ -21,6 +21,7 @@ #include #include #include +#include #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); }