From 2ddbacddd4021993f62eddfe35c3773bc2690f43 Mon Sep 17 00:00:00 2001 From: Jeroen Koekkoek Date: Mon, 3 Apr 2023 16:06:00 +0200 Subject: [PATCH] Drop unnecessary root server checks Fixes #275. --- configure.ac | 9 +-------- doc/ChangeLog | 3 +++ nsd-checkconf.c | 7 ------- zonec.c | 8 -------- 4 files changed, 4 insertions(+), 23 deletions(-) diff --git a/configure.ac b/configure.ac index 8701bd1d2..2e1148f8f 100644 --- a/configure.ac +++ b/configure.ac @@ -938,14 +938,7 @@ AC_DEFINE_UNQUOTED([TCP_TIMEOUT], $tcp_timeout, [Define to the default tcp timeo dnl dnl Features dnl -AC_ARG_ENABLE(root-server, AS_HELP_STRING([--enable-root-server],[Configure NSD as a root server])) -case "$enable_root_server" in - yes) - AC_DEFINE_UNQUOTED([ROOT_SERVER], [], [Define this to configure as a root server.]) - ;; - no|*) - ;; -esac +AC_ARG_ENABLE(root-server, AS_HELP_STRING([--enable-root-server],[Configure NSD as a root server (obsolete)])) AC_ARG_ENABLE(ipv6, AS_HELP_STRING([--disable-ipv6],[Disables IPv6 support])) case "$enable_ipv6" in diff --git a/doc/ChangeLog b/doc/ChangeLog index c13b643c6..76687b205 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,6 @@ +30 May 2023: Jeroen + - Fix #275: Drop unnecessary root server checks. + 30 May 2023: Wouter - Next version is 4.7.0, instead of 4.6.2, because of the added features, like TLS for DNSTAP. diff --git a/nsd-checkconf.c b/nsd-checkconf.c index 0f65b2728..970f4014e 100644 --- a/nsd-checkconf.c +++ b/nsd-checkconf.c @@ -791,13 +791,6 @@ additional_checks(nsd_options_type* opt, const char* filename) errors ++; continue; } -#ifndef ROOT_SERVER - /* Is it a root zone? Are we a root server then? Idiot proof. */ - if(dname->label_count == 1) { - fprintf(stderr, "%s: not configured as a root server.\n", filename); - errors ++; - } -#endif if(zone->pattern->allow_notify && !zone->pattern->request_xfr) { fprintf(stderr, "%s: zone %s has allow-notify but no request-xfr" " items. Where can it get a zone transfer when a notify " diff --git a/zonec.c b/zonec.c index b13473a9a..e868405da 100644 --- a/zonec.c +++ b/zonec.c @@ -2209,14 +2209,6 @@ zonec_read(const char* name, const char* zonefile, zone_type* zone) return 1; } -#ifndef ROOT_SERVER - /* Is it a root zone? Are we a root server then? Idiot proof. */ - if (dname->label_count == 1) { - zc_error("not configured as a root server"); - return 1; - } -#endif - /* Open the zone file */ if (!zone_open(zonefile, 3600, CLASS_IN, dname)) { zc_error("cannot open '%s': %s", zonefile, strerror(errno));