summaryrefslogtreecommitdiff
path: root/usr.sbin/ntpd/client.c
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2007-11-22 10:24:26 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2007-11-22 10:24:26 +0000
commit211d534c83cff823e3cafc15bfc9ca9ad1aeb756 (patch)
tree1d64def056ceff470c654c900cd40d7e18bf0298 /usr.sbin/ntpd/client.c
parent31ec668fbc4a4df033e6adc0f723af6c27de6a83 (diff)
be a bit less aggressive retrying; this keeps the message queue
empty while in the -s period, so the poll timeout actually times out if there are no interfaces available. ok henning@
Diffstat (limited to 'usr.sbin/ntpd/client.c')
-rw-r--r--usr.sbin/ntpd/client.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/ntpd/client.c b/usr.sbin/ntpd/client.c
index 9cc558eb79d..2d4c033cb09 100644
--- a/usr.sbin/ntpd/client.c
+++ b/usr.sbin/ntpd/client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: client.c,v 1.76 2007/05/01 07:40:45 otto Exp $ */
+/* $OpenBSD: client.c,v 1.77 2007/11/22 10:24:25 otto Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -123,7 +123,8 @@ client_query(struct ntp_peer *p)
int tos = IPTOS_LOWDELAY;
if (p->addr == NULL && client_nextaddr(p) == -1) {
- set_next(p, scale_interval(INTERVAL_QUERY_AGGRESSIVE));
+ set_next(p, MAX(SETTIME_TIMEOUT,
+ scale_interval(INTERVAL_QUERY_AGGRESSIVE)));
return (0);
}
@@ -140,8 +141,8 @@ client_query(struct ntp_peer *p)
if (errno == ECONNREFUSED || errno == ENETUNREACH ||
errno == EHOSTUNREACH || errno == EADDRNOTAVAIL) {
client_nextaddr(p);
- set_next(p,
- scale_interval(INTERVAL_QUERY_AGGRESSIVE));
+ set_next(p, MAX(SETTIME_TIMEOUT,
+ scale_interval(INTERVAL_QUERY_AGGRESSIVE)));
return (-1);
} else
fatal("client_query connect");