Browse Source

Make network unreachable errors non-fatal; ok henning@

OPENBSD_3_7
dtucker 20 years ago
parent
commit
e0c54820e7
2 changed files with 5 additions and 4 deletions
  1. +3
    -2
      src/usr.sbin/ntpd/client.c
  2. +2
    -2
      src/usr.sbin/ntpd/server.c

+ 3
- 2
src/usr.sbin/ntpd/client.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: client.c,v 1.53 2005/01/27 14:44:00 dtucker Exp $ */
/* $OpenBSD: client.c,v 1.54 2005/01/28 12:01:32 dtucker Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -180,7 +180,8 @@ client_dispatch(struct ntp_peer *p, u_int8_t settime)
if ((size = recvfrom(p->query->fd, &buf, sizeof(buf), 0,
NULL, NULL)) == -1) {
if (errno == EHOSTUNREACH || errno == EHOSTDOWN ||
errno == ENETDOWN || errno == ECONNREFUSED) {
errno == ENETUNREACH || errno == ENETDOWN ||
errno == ECONNREFUSED) {
log_warn("recvfrom %s",
log_sockaddr((struct sockaddr *)&p->addr->ss));
set_next(p, error_interval());


+ 2
- 2
src/usr.sbin/ntpd/server.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: server.c,v 1.20 2004/12/22 05:36:11 dtucker Exp $ */
/* $OpenBSD: server.c,v 1.21 2005/01/28 12:01:32 dtucker Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -112,7 +112,7 @@ server_dispatch(int fd, struct ntpd_conf *conf)
if ((size = recvfrom(fd, &buf, sizeof(buf), 0,
(struct sockaddr *)&fsa, &fsa_len)) == -1) {
if (errno == EHOSTUNREACH || errno == EHOSTDOWN ||
errno == ENETDOWN) {
errno == ENETUNREACH || errno == ENETDOWN) {
log_warn("recvfrom %s",
log_sockaddr((struct sockaddr *)&fsa));
return (0);


Loading…
Cancel
Save