diff options
Diffstat (limited to 'usr.sbin/bind')
-rw-r--r-- | usr.sbin/bind/bin/dig/dighost.c | 4 | ||||
-rw-r--r-- | usr.sbin/bind/bin/dig/host.c | 2 | ||||
-rw-r--r-- | usr.sbin/bind/lib/dns/gen-unix.h | 6 | ||||
-rw-r--r-- | usr.sbin/bind/lib/dns/include/dns/message.h | 3 | ||||
-rw-r--r-- | usr.sbin/bind/lib/dns/message.c | 62 | ||||
-rw-r--r-- | usr.sbin/bind/lib/isc/lex.c | 10 | ||||
-rw-r--r-- | usr.sbin/bind/lib/isc/unix/app.c | 26 | ||||
-rw-r--r-- | usr.sbin/bind/lib/isc/unix/net.c | 49 | ||||
-rw-r--r-- | usr.sbin/bind/lib/isc/unix/socket.c | 54 | ||||
-rw-r--r-- | usr.sbin/bind/lib/isccfg/namedconf.c | 12 | ||||
-rw-r--r-- | usr.sbin/bind/lib/lwres/lwconfig.c | 2 |
11 files changed, 5 insertions, 225 deletions
diff --git a/usr.sbin/bind/bin/dig/dighost.c b/usr.sbin/bind/bin/dig/dighost.c index 91fb5c6aeab..059391127b3 100644 --- a/usr.sbin/bind/bin/dig/dighost.c +++ b/usr.sbin/bind/bin/dig/dighost.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dighost.c,v 1.34 2020/01/21 23:59:20 tedu Exp $ */ +/* $Id: dighost.c,v 1.35 2020/01/22 12:58:35 florian Exp $ */ /*! \file * \note @@ -32,9 +32,7 @@ #include <string.h> #include <limits.h> -#ifdef HAVE_LOCALE_H #include <locale.h> -#endif #include <dns/byaddr.h> #ifdef DIG_SIGCHASE diff --git a/usr.sbin/bind/bin/dig/host.c b/usr.sbin/bind/bin/dig/host.c index cec0a556fc2..ddeb99e05c7 100644 --- a/usr.sbin/bind/bin/dig/host.c +++ b/usr.sbin/bind/bin/dig/host.c @@ -21,9 +21,7 @@ #include <unistd.h> #include <limits.h> -#ifdef HAVE_LOCALE_H #include <locale.h> -#endif #include <isc/app.h> #include <isc/commandline.h> diff --git a/usr.sbin/bind/lib/dns/gen-unix.h b/usr.sbin/bind/lib/dns/gen-unix.h index b245379e221..a17a330b749 100644 --- a/usr.sbin/bind/lib/dns/gen-unix.h +++ b/usr.sbin/bind/lib/dns/gen-unix.h @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: gen-unix.h,v 1.3 2019/12/17 01:46:31 sthen Exp $ */ +/* $Id: gen-unix.h,v 1.4 2020/01/22 12:58:35 florian Exp $ */ /*! \file * \brief @@ -40,10 +40,6 @@ #include <isc/boolean.h> #include <isc/lang.h> -#ifdef NEED_OPTARG -extern char *optarg; -#endif - #define isc_commandline_parse getopt #define isc_commandline_argument optarg diff --git a/usr.sbin/bind/lib/dns/include/dns/message.h b/usr.sbin/bind/lib/dns/include/dns/message.h index a1e4d77f750..755c75a96f7 100644 --- a/usr.sbin/bind/lib/dns/include/dns/message.h +++ b/usr.sbin/bind/lib/dns/include/dns/message.h @@ -180,9 +180,6 @@ typedef int dns_messagetextflag_t; additional section. */ #define DNS_MESSAGERENDER_PREFER_AAAA 0x0010 /*%< prefer AAAA records in additional section. */ -#ifdef ALLOW_FILTER_AAAA -#define DNS_MESSAGERENDER_FILTER_AAAA 0x0020 /*%< filter AAAA records */ -#endif typedef struct dns_msgblock dns_msgblock_t; diff --git a/usr.sbin/bind/lib/dns/message.c b/usr.sbin/bind/lib/dns/message.c index cd9577384c2..fd3ebb278ef 100644 --- a/usr.sbin/bind/lib/dns/message.c +++ b/usr.sbin/bind/lib/dns/message.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: message.c,v 1.15 2020/01/22 12:57:21 florian Exp $ */ +/* $Id: message.c,v 1.16 2020/01/22 12:58:35 florian Exp $ */ /*! \file */ @@ -1859,50 +1859,6 @@ wrong_priority(dns_rdataset_t *rds, int pass, dns_rdatatype_t preferred_glue) { return (ISC_TRUE); } -#ifdef ALLOW_FILTER_AAAA -/* - * Decide whether to not answer with an AAAA record and its RRSIG - */ -static inline isc_boolean_t -norender_rdataset(const dns_rdataset_t *rdataset, unsigned int options, - dns_section_t sectionid) -{ - if (sectionid == DNS_SECTION_QUESTION) - return (ISC_FALSE); - - switch (rdataset->type) { - case dns_rdatatype_ns: - if ((options & DNS_MESSAGERENDER_FILTER_AAAA) == 0 || - sectionid != DNS_SECTION_AUTHORITY) - return (ISC_FALSE); - break; - - case dns_rdatatype_aaaa: - if ((options & DNS_MESSAGERENDER_FILTER_AAAA) == 0) - return (ISC_FALSE); - break; - - case dns_rdatatype_rrsig: - if ((options & DNS_MESSAGERENDER_FILTER_AAAA) == 0 || - (rdataset->covers != dns_rdatatype_ns && - rdataset->covers != dns_rdatatype_aaaa)) - return (ISC_FALSE); - if ((rdataset->covers == dns_rdatatype_ns) && - (sectionid != DNS_SECTION_AUTHORITY)) - return (ISC_FALSE); - break; - - default: - return (ISC_FALSE); - } - - if (rdataset->rdclass != dns_rdataclass_in) - return (ISC_FALSE); - - return (ISC_TRUE); -} -#endif - static isc_result_t renderset(dns_rdataset_t *rdataset, dns_name_t *owner_name, dns_compress_t *cctx, isc_buffer_t *target, @@ -2062,22 +2018,6 @@ dns_message_rendersection(dns_message_t *msg, dns_section_t sectionid, preferred_glue)) goto next; -#ifdef ALLOW_FILTER_AAAA - /* - * Suppress AAAAs if asked and we are - * not doing DNSSEC or are breaking DNSSEC. - * Say so in the AD bit if we break DNSSEC. - */ - if (norender_rdataset(rdataset, options, sectionid)) { - if (sectionid == DNS_SECTION_ANSWER || - sectionid == DNS_SECTION_AUTHORITY) - msg->flags &= ~DNS_MESSAGEFLAG_AD; - if (OPTOUT(rdataset)) - msg->flags &= ~DNS_MESSAGEFLAG_AD; - goto next; - } - -#endif st = *(msg->buffer); count = 0; diff --git a/usr.sbin/bind/lib/isc/lex.c b/usr.sbin/bind/lib/isc/lex.c index 306b03da211..64096150559 100644 --- a/usr.sbin/bind/lib/isc/lex.c +++ b/usr.sbin/bind/lib/isc/lex.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: lex.c,v 1.13 2020/01/20 18:51:53 florian Exp $ */ +/* $Id: lex.c,v 1.14 2020/01/22 12:58:35 florian Exp $ */ /*! \file */ @@ -416,21 +416,15 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) { prev = NULL; remaining = lex->max_token; -#ifdef HAVE_FLOCKFILE if (source->is_file) flockfile(source->input); -#endif do { if (isc_buffer_remaininglength(source->pushback) == 0) { if (source->is_file) { stream = source->input; -#if defined(HAVE_FLOCKFILE) && defined(HAVE_GETCUNLOCKED) c = getc_unlocked(stream); -#else - c = getc(stream); -#endif if (c == EOF) { if (ferror(stream)) { source->result = ISC_R_IOERROR; @@ -786,10 +780,8 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) { result = ISC_R_SUCCESS; done: -#ifdef HAVE_FLOCKFILE if (source->is_file) funlockfile(source->input); -#endif return (result); } diff --git a/usr.sbin/bind/lib/isc/unix/app.c b/usr.sbin/bind/lib/isc/unix/app.c index 2b1b885b9ee..287e5625776 100644 --- a/usr.sbin/bind/lib/isc/unix/app.c +++ b/usr.sbin/bind/lib/isc/unix/app.c @@ -139,19 +139,11 @@ static struct { (void *)isc__app_unblock }; -#ifndef HAVE_SIGWAIT -static void -exit_action(int arg) { - UNUSED(arg); - isc_g_appctx.want_shutdown = ISC_TRUE; -} - static void reload_action(int arg) { UNUSED(arg); isc_g_appctx.want_reload = ISC_TRUE; } -#endif static isc_result_t handle_signal(int sig, void (*handler)(int)) { @@ -194,22 +186,6 @@ isc__app_ctxstart(isc_appctx_t *ctx0) { ctx->want_reload = ISC_FALSE; ctx->blocked = ISC_FALSE; -#ifndef HAVE_SIGWAIT - /* - * Install do-nothing handlers for SIGINT and SIGTERM. - * - * We install them now because BSDI 3.1 won't block - * the default actions, regardless of what we do with - * pthread_sigmask(). - */ - result = handle_signal(SIGINT, exit_action); - if (result != ISC_R_SUCCESS) - goto cleanup; - result = handle_signal(SIGTERM, exit_action); - if (result != ISC_R_SUCCESS) - goto cleanup; -#endif - /* * Always ignore SIGPIPE. */ @@ -230,14 +206,12 @@ isc__app_ctxstart(isc_appctx_t *ctx0) { if (result != ISC_R_SUCCESS) goto cleanup; -#ifdef HAVE_SIGWAIT result = handle_signal(SIGTERM, SIG_DFL); if (result != ISC_R_SUCCESS) goto cleanup; result = handle_signal(SIGINT, SIG_DFL); if (result != ISC_R_SUCCESS) goto cleanup; -#endif /* * Unblock SIGHUP, SIGINT, SIGTERM. diff --git a/usr.sbin/bind/lib/isc/unix/net.c b/usr.sbin/bind/lib/isc/unix/net.c index 7afd89f6017..f579098aab9 100644 --- a/usr.sbin/bind/lib/isc/unix/net.c +++ b/usr.sbin/bind/lib/isc/unix/net.c @@ -14,18 +14,14 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: net.c,v 1.13 2020/01/22 12:56:14 florian Exp $ */ +/* $Id: net.c,v 1.14 2020/01/22 12:58:35 florian Exp $ */ #include <config.h> #include <sys/types.h> -#if defined(HAVE_SYS_SYSCTL_H) -#if defined(HAVE_SYS_PARAM_H) #include <sys/param.h> -#endif #include <sys/sysctl.h> -#endif #include <sys/uio.h> #include <errno.h> @@ -58,29 +54,6 @@ #define ISC_NET_PORTRANGEHIGH 65535 #endif /* ISC_NET_PORTRANGEHIGH */ -#ifdef HAVE_SYSCTLBYNAME - -/*% - * sysctl variants - */ -#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__DragonFly__) -#define USE_SYSCTL_PORTRANGE -#define SYSCTL_V4PORTRANGE_LOW "net.inet.ip.portrange.hifirst" -#define SYSCTL_V4PORTRANGE_HIGH "net.inet.ip.portrange.hilast" -#define SYSCTL_V6PORTRANGE_LOW "net.inet.ip.portrange.hifirst" -#define SYSCTL_V6PORTRANGE_HIGH "net.inet.ip.portrange.hilast" -#endif - -#ifdef __NetBSD__ -#define USE_SYSCTL_PORTRANGE -#define SYSCTL_V4PORTRANGE_LOW "net.inet.ip.anonportmin" -#define SYSCTL_V4PORTRANGE_HIGH "net.inet.ip.anonportmax" -#define SYSCTL_V6PORTRANGE_LOW "net.inet6.ip6.anonportmin" -#define SYSCTL_V6PORTRANGE_HIGH "net.inet6.ip6.anonportmax" -#endif - -#else /* !HAVE_SYSCTLBYNAME */ - #ifdef __OpenBSD__ #define USE_SYSCTL_PORTRANGE #define SYSCTL_V4PORTRANGE_LOW { CTL_NET, PF_INET, IPPROTO_IP, \ @@ -92,13 +65,9 @@ #define SYSCTL_V6PORTRANGE_HIGH SYSCTL_V4PORTRANGE_HIGH #endif -#endif /* HAVE_SYSCTLBYNAME */ - -# if defined(WANT_IPV6) static isc_once_t once_ipv6only = ISC_ONCE_INIT; static isc_once_t once_ipv6pktinfo = ISC_ONCE_INIT; -# endif /* WANT_IPV6 */ #ifndef ISC_CMSG_IP_TOS #ifdef __APPLE__ @@ -150,7 +119,6 @@ try_proto(int domain) { } } -#ifdef WANT_IPV6 if (domain == PF_INET6) { struct sockaddr_in6 sin6; unsigned int len; @@ -188,7 +156,6 @@ try_proto(int domain) { } } } -#endif (void)close(s); @@ -198,9 +165,7 @@ try_proto(int domain) { static void initialize_action(void) { ipv4_result = try_proto(PF_INET); -#ifdef WANT_IPV6 ipv6_result = try_proto(PF_INET6); -#endif } static void @@ -226,7 +191,6 @@ isc_net_probeunix(void) { return (unix_result); } -#ifdef WANT_IPV6 static void try_ipv6only(void) { #ifdef IPV6_V6ONLY @@ -292,9 +256,7 @@ initialize_ipv6only(void) { RUNTIME_CHECK(isc_once_do(&once_ipv6only, try_ipv6only) == ISC_R_SUCCESS); } -#endif /* WANT_IPV6 */ -#ifdef WANT_IPV6 static void try_ipv6pktinfo(void) { int s, on; @@ -341,25 +303,16 @@ initialize_ipv6pktinfo(void) { RUNTIME_CHECK(isc_once_do(&once_ipv6pktinfo, try_ipv6pktinfo) == ISC_R_SUCCESS); } -#endif /* WANT_IPV6 */ isc_result_t isc_net_probe_ipv6only(void) { -#ifdef WANT_IPV6 initialize_ipv6only(); -#else - ipv6only_result = ISC_R_NOTFOUND; -#endif return (ipv6only_result); } isc_result_t isc_net_probe_ipv6pktinfo(void) { -#ifdef WANT_IPV6 initialize_ipv6pktinfo(); -#else - ipv6pktinfo_result = ISC_R_NOTFOUND; -#endif return (ipv6pktinfo_result); } diff --git a/usr.sbin/bind/lib/isc/unix/socket.c b/usr.sbin/bind/lib/isc/unix/socket.c index 6e9a491ba69..4ab1098049b 100644 --- a/usr.sbin/bind/lib/isc/unix/socket.c +++ b/usr.sbin/bind/lib/isc/unix/socket.c @@ -31,9 +31,7 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> -#ifdef HAVE_INTTYPES_H #include <inttypes.h> /* uintptr_t */ -#endif #include <isc/buffer.h> #include <isc/bufferlist.h> @@ -159,15 +157,7 @@ typedef isc_event_t intev_t; /*% * The size to raise the receive buffer to (from BIND 8). */ -#ifdef TUNE_LARGE -#ifdef sun -#define RCVBUFSIZE (1*1024*1024) -#else -#define RCVBUFSIZE (16*1024*1024) -#endif -#else #define RCVBUFSIZE (32*1024) -#endif /* TUNE_LARGE */ /*% * Instead of calculating the cmsgbuf lengths every time we take @@ -624,28 +614,16 @@ static isc_result_t make_nonblock(int fd) { int ret; char strbuf[ISC_STRERRORSIZE]; -#ifdef USE_FIONBIO_IOCTL - int on = 1; -#else int flags; -#endif -#ifdef USE_FIONBIO_IOCTL - ret = ioctl(fd, FIONBIO, (char *)&on); -#else flags = fcntl(fd, F_GETFL, 0); flags |= O_NONBLOCK; ret = fcntl(fd, F_SETFL, flags); -#endif if (ret == -1) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, -#ifdef USE_FIONBIO_IOCTL - "ioctl(%d, FIONBIO, &on): %s", fd, -#else "fcntl(%d, F_SETFL, %d): %s", fd, flags, -#endif strbuf); return (ISC_R_UNEXPECTED); @@ -1027,24 +1005,8 @@ build_msghdr_recv(isc__socket_t *sock, char *cmsgbuf, isc_socketevent_t *dev, if (sock->type == isc_sockettype_udp) { memset(&dev->address, 0, sizeof(dev->address)); -#ifdef BROKEN_RECVMSG - if (sock->pf == AF_INET) { - msg->msg_name = (void *)&dev->address.type.sin; - msg->msg_namelen = sizeof(dev->address.type.sin6); - } else if (sock->pf == AF_INET6) { - msg->msg_name = (void *)&dev->address.type.sin6; - msg->msg_namelen = sizeof(dev->address.type.sin6); - } else if (sock->pf == AF_UNIX) { - msg->msg_name = (void *)&dev->address.type.sunix; - msg->msg_namelen = sizeof(dev->address.type.sunix); - } else { - msg->msg_name = (void *)&dev->address.type.sa; - msg->msg_namelen = sizeof(dev->address.type); - } -#else msg->msg_name = (void *)&dev->address.type.sa; msg->msg_namelen = sizeof(dev->address.type); -#endif } else { /* TCP */ msg->msg_name = NULL; msg->msg_namelen = 0; @@ -3751,27 +3713,11 @@ isc__socket_permunix(isc_sockaddr_t *sockaddr, uint32_t perm, isc_result_t result = ISC_R_SUCCESS; char strbuf[ISC_STRERRORSIZE]; char path[sizeof(sockaddr->type.sunix.sun_path)]; -#ifdef NEED_SECURE_DIRECTORY - char *slash; -#endif REQUIRE(sockaddr->type.sa.sa_family == AF_UNIX); INSIST(strlen(sockaddr->type.sunix.sun_path) < sizeof(path)); strlcpy(path, sockaddr->type.sunix.sun_path, sizeof(path)); -#ifdef NEED_SECURE_DIRECTORY - slash = strrchr(path, '/'); - if (slash != NULL) { - if (slash != path) { - *slash = '\0'; - } else { - strlcpy(path, "/", sizeof(path)); - } - } else { - strlcpy(path, ".", sizeof(path)); - } -#endif - if (chmod(path, perm) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, diff --git a/usr.sbin/bind/lib/isccfg/namedconf.c b/usr.sbin/bind/lib/isccfg/namedconf.c index 7b0e0d44c98..db9df6330b6 100644 --- a/usr.sbin/bind/lib/isccfg/namedconf.c +++ b/usr.sbin/bind/lib/isccfg/namedconf.c @@ -1550,30 +1550,18 @@ view_clauses[] = { { "empty-server", &cfg_type_astring, 0 }, { "empty-zones-enable", &cfg_type_boolean, 0 }, { "fetch-glue", &cfg_type_boolean, CFG_CLAUSEFLAG_OBSOLETE }, -#ifdef ENABLE_FETCHLIMIT - { "fetch-quota-params", &cfg_type_fetchquota, 0 }, - { "fetches-per-server", &cfg_type_fetchesper, 0 }, - { "fetches-per-zone", &cfg_type_fetchesper, 0 }, -#else { "fetch-quota-params", &cfg_type_fetchquota, CFG_CLAUSEFLAG_NOTCONFIGURED }, { "fetches-per-server", &cfg_type_fetchesper, CFG_CLAUSEFLAG_NOTCONFIGURED }, { "fetches-per-zone", &cfg_type_fetchesper, CFG_CLAUSEFLAG_NOTCONFIGURED }, -#endif /* ENABLE_FETCHLIMIT */ -#ifdef ALLOW_FILTER_AAAA - { "filter-aaaa", &cfg_type_bracketed_aml, 0 }, - { "filter-aaaa-on-v4", &cfg_type_filter_aaaa, 0 }, - { "filter-aaaa-on-v6", &cfg_type_filter_aaaa, 0 }, -#else { "filter-aaaa", &cfg_type_bracketed_aml, CFG_CLAUSEFLAG_NOTCONFIGURED }, { "filter-aaaa-on-v4", &cfg_type_filter_aaaa, CFG_CLAUSEFLAG_NOTCONFIGURED }, { "filter-aaaa-on-v6", &cfg_type_filter_aaaa, CFG_CLAUSEFLAG_NOTCONFIGURED }, -#endif { "ixfr-from-differences", &cfg_type_ixfrdifftype, 0 }, { "lame-ttl", &cfg_type_uint32, 0 }, { "max-acache-size", &cfg_type_sizenodefault, 0 }, diff --git a/usr.sbin/bind/lib/lwres/lwconfig.c b/usr.sbin/bind/lib/lwres/lwconfig.c index 02635b9212b..81dc439a5aa 100644 --- a/usr.sbin/bind/lib/lwres/lwconfig.c +++ b/usr.sbin/bind/lib/lwres/lwconfig.c @@ -425,13 +425,11 @@ lwres_create_addr(const char *buffer, lwres_addr_t *addr, int convert_zero) { percent++; -#ifdef HAVE_IF_NAMETOINDEX zone = if_nametoindex(percent); if (zone != 0U) { addr->zone = zone; return (LWRES_R_SUCCESS); } -#endif zone = strtoul(percent, &ep, 10); if (ep != percent && *ep == 0) addr->zone = zone; |