-/* $OpenBSD: client.c,v 1.94 2015/01/04 01:19:46 bcook Exp $ */
+/* $OpenBSD: client.c,v 1.95 2015/01/04 01:48:49 bcook Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
return (0);
}
-#define SCALE_MAX(a, b) ((a) > (b) ? (a) : (b))
-
int
client_query(struct ntp_peer *p)
{
int val;
if (p->addr == NULL && client_nextaddr(p) == -1) {
- set_next(p, SCALE_MAX(SETTIME_TIMEOUT,
+ set_next(p, MAXIMUM(SETTIME_TIMEOUT,
scale_interval(INTERVAL_QUERY_AGGRESSIVE)));
return (0);
}
if (errno == ECONNREFUSED || errno == ENETUNREACH ||
errno == EHOSTUNREACH || errno == EADDRNOTAVAIL) {
client_nextaddr(p);
- set_next(p, SCALE_MAX(SETTIME_TIMEOUT,
+ set_next(p, MAXIMUM(SETTIME_TIMEOUT,
scale_interval(INTERVAL_QUERY_AGGRESSIVE)));
return (-1);
} else
-/* $OpenBSD: ntp.c,v 1.123 2015/01/04 01:19:46 bcook Exp $ */
+/* $OpenBSD: ntp.c,v 1.124 2015/01/04 01:48:49 bcook Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
conf->scale = QSCALE_OFF_MAX / offset;
}
-#define SCALE_MAX(a, b) ((a) > (b) ? (a) : (b))
-
time_t
scale_interval(time_t requested)
{
time_t interval, r;
interval = requested * conf->scale;
- r = arc4random_uniform(SCALE_MAX(5, interval / 10));
+ r = arc4random_uniform(MAXIMUM(5, interval / 10));
return (interval + r);
}
-/* $OpenBSD: ntpd.h,v 1.112 2015/01/04 01:13:10 bcook Exp $ */
+/* $OpenBSD: ntpd.h,v 1.113 2015/01/04 01:48:49 bcook Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
#include "ntp.h"
#include <imsg.h>
+#define MAXIMUM(a, b) ((a) > (b) ? (a) : (b))
+
#define NTPD_USER "_ntp"
#define CONFFILE "/etc/ntpd.conf"
#define DRIFTFILE "/var/db/ntpd.drift"