diff options
author | Darren Tucker <dtucker@cvs.openbsd.org> | 2004-12-16 00:39:00 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@cvs.openbsd.org> | 2004-12-16 00:39:00 +0000 |
commit | 704d6797b8f70caab66c8bdb86ef36bd8125fb73 (patch) | |
tree | 14aceb7caa86565a43e3fcb0a6b19c67ab997a32 /usr.sbin/ntpd | |
parent | 636470a69a0fccfac669e5d2cf7d89a85de42228 (diff) |
Limit the number of addresses used by the 'servers' directive to 8; ok henning@
Diffstat (limited to 'usr.sbin/ntpd')
-rw-r--r-- | usr.sbin/ntpd/config.c | 4 | ||||
-rw-r--r-- | usr.sbin/ntpd/ntpd.h | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/ntpd/config.c b/usr.sbin/ntpd/config.c index 8646accbd8a..bd5a49eb83d 100644 --- a/usr.sbin/ntpd/config.c +++ b/usr.sbin/ntpd/config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.14 2004/08/30 12:02:59 henning Exp $ */ +/* $OpenBSD: config.c,v 1.15 2004/12/16 00:38:59 dtucker Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -133,7 +133,7 @@ host_dns(const char *s, struct ntp_addr **hn) return (-1); } - for (res = res0; res; res = res->ai_next) { + for (res = res0; res && cnt < MAX_SERVERS_DNS; res = res->ai_next) { if (res->ai_family != AF_INET && res->ai_family != AF_INET6) continue; diff --git a/usr.sbin/ntpd/ntpd.h b/usr.sbin/ntpd/ntpd.h index 19168fe9578..b6b90bcdb46 100644 --- a/usr.sbin/ntpd/ntpd.h +++ b/usr.sbin/ntpd/ntpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ntpd.h,v 1.47 2004/12/09 20:24:46 mickey Exp $ */ +/* $OpenBSD: ntpd.h,v 1.48 2004/12/16 00:38:59 dtucker Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -47,6 +47,8 @@ #define TRUSTLEVEL_AGRESSIVE 8 #define TRUSTLEVEL_MAX 10 +#define MAX_SERVERS_DNS 8 + #define QSCALE_OFF_MIN 0.05 #define QSCALE_OFF_MAX 0.50 |