Browse Source

ENOBUFS, EHOSTUNREACH, ENETDOWN and EHOSTDOWN are bad reasons to log; ok otto henning

OPENBSD_3_6
deraadt 20 years ago
parent
commit
f66c7f6404
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      src/usr.sbin/ntpd/ntp_msg.c

+ 7
- 1
src/usr.sbin/ntpd/ntp_msg.c View File

@ -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> * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -21,6 +21,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h>
#include "ntpd.h" #include "ntpd.h"
#include "ntp.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 (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"); log_warn("sendto");
return (-1); return (-1);
} }


Loading…
Cancel
Save