summaryrefslogtreecommitdiff
path: root/usr.sbin/ntpd/server.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-07-18 13:26:54 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-07-18 13:26:54 +0000
commitbc1a9dd2f65b9d17b6a423130cd5a1fee56270a5 (patch)
treef69ae84aba915b9344a10967d3fc72887752e3ba /usr.sbin/ntpd/server.c
parent73d5425879a7329ba6be5b1c2ff8a45c60d8dfa9 (diff)
there are a few recvfrom(2) errors we do not want to panic on
Diffstat (limited to 'usr.sbin/ntpd/server.c')
-rw-r--r--usr.sbin/ntpd/server.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/usr.sbin/ntpd/server.c b/usr.sbin/ntpd/server.c
index 25fdb861b75..fc1525e51da 100644
--- a/usr.sbin/ntpd/server.c
+++ b/usr.sbin/ntpd/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.11 2004/07/14 20:16:31 henning Exp $ */
+/* $OpenBSD: server.c,v 1.12 2004/07/18 13:26:53 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -105,8 +105,15 @@ server_dispatch(int fd, struct ntpd_conf *conf)
fsa_len = sizeof(fsa);
if ((size = recvfrom(fd, &buf, sizeof(buf), 0,
- (struct sockaddr *)&fsa, &fsa_len)) == -1)
- fatal("recvfrom");
+ (struct sockaddr *)&fsa, &fsa_len)) == -1) {
+ if (errno == EHOSTUNREACH || errno == EHOSTDOWN ||
+ errno == ENETDOWN) {
+ log_warn("recvfrom %s",
+ log_sockaddr((struct sockaddr *)&fsa));
+ return (0);
+ } else
+ fatal("recvfrom");
+ }
rectime = gettime();