From 2dc039e3480a56ef38f353118e14d752e1fdce4c Mon Sep 17 00:00:00 2001 From: otto <> Date: Thu, 22 Nov 2007 10:24:25 +0000 Subject: [PATCH] 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@ --- src/usr.sbin/ntpd/client.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/usr.sbin/ntpd/client.c b/src/usr.sbin/ntpd/client.c index 9cc558eb..2d4c033c 100644 --- a/src/usr.sbin/ntpd/client.c +++ b/src/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 @@ -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");