merge differences between nsd-4.6.0 and nsd-4.8.0

This commit is contained in:
christos 2024-02-17 17:43:19 +00:00
parent c86048e20d
commit 36f29c42dc
18 changed files with 3175 additions and 5587 deletions

View File

@ -1,2 +0,0 @@
github: [NLnetLabs]
custom: ['https://nlnetlabs.nl/funding/']

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -115,79 +115,86 @@ extern int c_debug;
VAR_TLS_SERVICE_OCSP = 316, /* VAR_TLS_SERVICE_OCSP */
VAR_TLS_PORT = 317, /* VAR_TLS_PORT */
VAR_TLS_CERT_BUNDLE = 318, /* VAR_TLS_CERT_BUNDLE */
VAR_CPU_AFFINITY = 319, /* VAR_CPU_AFFINITY */
VAR_XFRD_CPU_AFFINITY = 320, /* VAR_XFRD_CPU_AFFINITY */
VAR_SERVER_CPU_AFFINITY = 321, /* VAR_SERVER_CPU_AFFINITY */
VAR_DROP_UPDATES = 322, /* VAR_DROP_UPDATES */
VAR_XFRD_TCP_MAX = 323, /* VAR_XFRD_TCP_MAX */
VAR_XFRD_TCP_PIPELINE = 324, /* VAR_XFRD_TCP_PIPELINE */
VAR_DNSTAP = 325, /* VAR_DNSTAP */
VAR_DNSTAP_ENABLE = 326, /* VAR_DNSTAP_ENABLE */
VAR_DNSTAP_SOCKET_PATH = 327, /* VAR_DNSTAP_SOCKET_PATH */
VAR_DNSTAP_SEND_IDENTITY = 328, /* VAR_DNSTAP_SEND_IDENTITY */
VAR_DNSTAP_SEND_VERSION = 329, /* VAR_DNSTAP_SEND_VERSION */
VAR_DNSTAP_IDENTITY = 330, /* VAR_DNSTAP_IDENTITY */
VAR_DNSTAP_VERSION = 331, /* VAR_DNSTAP_VERSION */
VAR_DNSTAP_LOG_AUTH_QUERY_MESSAGES = 332, /* VAR_DNSTAP_LOG_AUTH_QUERY_MESSAGES */
VAR_DNSTAP_LOG_AUTH_RESPONSE_MESSAGES = 333, /* VAR_DNSTAP_LOG_AUTH_RESPONSE_MESSAGES */
VAR_REMOTE_CONTROL = 334, /* VAR_REMOTE_CONTROL */
VAR_CONTROL_ENABLE = 335, /* VAR_CONTROL_ENABLE */
VAR_CONTROL_INTERFACE = 336, /* VAR_CONTROL_INTERFACE */
VAR_CONTROL_PORT = 337, /* VAR_CONTROL_PORT */
VAR_SERVER_KEY_FILE = 338, /* VAR_SERVER_KEY_FILE */
VAR_SERVER_CERT_FILE = 339, /* VAR_SERVER_CERT_FILE */
VAR_CONTROL_KEY_FILE = 340, /* VAR_CONTROL_KEY_FILE */
VAR_CONTROL_CERT_FILE = 341, /* VAR_CONTROL_CERT_FILE */
VAR_KEY = 342, /* VAR_KEY */
VAR_ALGORITHM = 343, /* VAR_ALGORITHM */
VAR_SECRET = 344, /* VAR_SECRET */
VAR_TLS_AUTH = 345, /* VAR_TLS_AUTH */
VAR_TLS_AUTH_DOMAIN_NAME = 346, /* VAR_TLS_AUTH_DOMAIN_NAME */
VAR_TLS_AUTH_CLIENT_CERT = 347, /* VAR_TLS_AUTH_CLIENT_CERT */
VAR_TLS_AUTH_CLIENT_KEY = 348, /* VAR_TLS_AUTH_CLIENT_KEY */
VAR_TLS_AUTH_CLIENT_KEY_PW = 349, /* VAR_TLS_AUTH_CLIENT_KEY_PW */
VAR_PATTERN = 350, /* VAR_PATTERN */
VAR_NAME = 351, /* VAR_NAME */
VAR_ZONEFILE = 352, /* VAR_ZONEFILE */
VAR_NOTIFY = 353, /* VAR_NOTIFY */
VAR_PROVIDE_XFR = 354, /* VAR_PROVIDE_XFR */
VAR_ALLOW_QUERY = 355, /* VAR_ALLOW_QUERY */
VAR_AXFR = 356, /* VAR_AXFR */
VAR_UDP = 357, /* VAR_UDP */
VAR_NOTIFY_RETRY = 358, /* VAR_NOTIFY_RETRY */
VAR_ALLOW_NOTIFY = 359, /* VAR_ALLOW_NOTIFY */
VAR_REQUEST_XFR = 360, /* VAR_REQUEST_XFR */
VAR_ALLOW_AXFR_FALLBACK = 361, /* VAR_ALLOW_AXFR_FALLBACK */
VAR_OUTGOING_INTERFACE = 362, /* VAR_OUTGOING_INTERFACE */
VAR_ANSWER_COOKIE = 363, /* VAR_ANSWER_COOKIE */
VAR_COOKIE_SECRET = 364, /* VAR_COOKIE_SECRET */
VAR_COOKIE_SECRET_FILE = 365, /* VAR_COOKIE_SECRET_FILE */
VAR_MAX_REFRESH_TIME = 366, /* VAR_MAX_REFRESH_TIME */
VAR_MIN_REFRESH_TIME = 367, /* VAR_MIN_REFRESH_TIME */
VAR_MAX_RETRY_TIME = 368, /* VAR_MAX_RETRY_TIME */
VAR_MIN_RETRY_TIME = 369, /* VAR_MIN_RETRY_TIME */
VAR_MIN_EXPIRE_TIME = 370, /* VAR_MIN_EXPIRE_TIME */
VAR_MULTI_MASTER_CHECK = 371, /* VAR_MULTI_MASTER_CHECK */
VAR_SIZE_LIMIT_XFR = 372, /* VAR_SIZE_LIMIT_XFR */
VAR_ZONESTATS = 373, /* VAR_ZONESTATS */
VAR_INCLUDE_PATTERN = 374, /* VAR_INCLUDE_PATTERN */
VAR_STORE_IXFR = 375, /* VAR_STORE_IXFR */
VAR_IXFR_SIZE = 376, /* VAR_IXFR_SIZE */
VAR_IXFR_NUMBER = 377, /* VAR_IXFR_NUMBER */
VAR_CREATE_IXFR = 378, /* VAR_CREATE_IXFR */
VAR_ZONE = 379, /* VAR_ZONE */
VAR_RRL_WHITELIST = 380, /* VAR_RRL_WHITELIST */
VAR_SERVERS = 381, /* VAR_SERVERS */
VAR_BINDTODEVICE = 382, /* VAR_BINDTODEVICE */
VAR_SETFIB = 383, /* VAR_SETFIB */
VAR_VERIFY = 384, /* VAR_VERIFY */
VAR_ENABLE = 385, /* VAR_ENABLE */
VAR_VERIFY_ZONE = 386, /* VAR_VERIFY_ZONE */
VAR_VERIFY_ZONES = 387, /* VAR_VERIFY_ZONES */
VAR_VERIFIER = 388, /* VAR_VERIFIER */
VAR_VERIFIER_COUNT = 389, /* VAR_VERIFIER_COUNT */
VAR_VERIFIER_FEED_ZONE = 390, /* VAR_VERIFIER_FEED_ZONE */
VAR_VERIFIER_TIMEOUT = 391 /* VAR_VERIFIER_TIMEOUT */
VAR_PROXY_PROTOCOL_PORT = 319, /* VAR_PROXY_PROTOCOL_PORT */
VAR_CPU_AFFINITY = 320, /* VAR_CPU_AFFINITY */
VAR_XFRD_CPU_AFFINITY = 321, /* VAR_XFRD_CPU_AFFINITY */
VAR_SERVER_CPU_AFFINITY = 322, /* VAR_SERVER_CPU_AFFINITY */
VAR_DROP_UPDATES = 323, /* VAR_DROP_UPDATES */
VAR_XFRD_TCP_MAX = 324, /* VAR_XFRD_TCP_MAX */
VAR_XFRD_TCP_PIPELINE = 325, /* VAR_XFRD_TCP_PIPELINE */
VAR_DNSTAP = 326, /* VAR_DNSTAP */
VAR_DNSTAP_ENABLE = 327, /* VAR_DNSTAP_ENABLE */
VAR_DNSTAP_SOCKET_PATH = 328, /* VAR_DNSTAP_SOCKET_PATH */
VAR_DNSTAP_IP = 329, /* VAR_DNSTAP_IP */
VAR_DNSTAP_TLS = 330, /* VAR_DNSTAP_TLS */
VAR_DNSTAP_TLS_SERVER_NAME = 331, /* VAR_DNSTAP_TLS_SERVER_NAME */
VAR_DNSTAP_TLS_CERT_BUNDLE = 332, /* VAR_DNSTAP_TLS_CERT_BUNDLE */
VAR_DNSTAP_TLS_CLIENT_KEY_FILE = 333, /* VAR_DNSTAP_TLS_CLIENT_KEY_FILE */
VAR_DNSTAP_TLS_CLIENT_CERT_FILE = 334, /* VAR_DNSTAP_TLS_CLIENT_CERT_FILE */
VAR_DNSTAP_SEND_IDENTITY = 335, /* VAR_DNSTAP_SEND_IDENTITY */
VAR_DNSTAP_SEND_VERSION = 336, /* VAR_DNSTAP_SEND_VERSION */
VAR_DNSTAP_IDENTITY = 337, /* VAR_DNSTAP_IDENTITY */
VAR_DNSTAP_VERSION = 338, /* VAR_DNSTAP_VERSION */
VAR_DNSTAP_LOG_AUTH_QUERY_MESSAGES = 339, /* VAR_DNSTAP_LOG_AUTH_QUERY_MESSAGES */
VAR_DNSTAP_LOG_AUTH_RESPONSE_MESSAGES = 340, /* VAR_DNSTAP_LOG_AUTH_RESPONSE_MESSAGES */
VAR_REMOTE_CONTROL = 341, /* VAR_REMOTE_CONTROL */
VAR_CONTROL_ENABLE = 342, /* VAR_CONTROL_ENABLE */
VAR_CONTROL_INTERFACE = 343, /* VAR_CONTROL_INTERFACE */
VAR_CONTROL_PORT = 344, /* VAR_CONTROL_PORT */
VAR_SERVER_KEY_FILE = 345, /* VAR_SERVER_KEY_FILE */
VAR_SERVER_CERT_FILE = 346, /* VAR_SERVER_CERT_FILE */
VAR_CONTROL_KEY_FILE = 347, /* VAR_CONTROL_KEY_FILE */
VAR_CONTROL_CERT_FILE = 348, /* VAR_CONTROL_CERT_FILE */
VAR_KEY = 349, /* VAR_KEY */
VAR_ALGORITHM = 350, /* VAR_ALGORITHM */
VAR_SECRET = 351, /* VAR_SECRET */
VAR_TLS_AUTH = 352, /* VAR_TLS_AUTH */
VAR_TLS_AUTH_DOMAIN_NAME = 353, /* VAR_TLS_AUTH_DOMAIN_NAME */
VAR_TLS_AUTH_CLIENT_CERT = 354, /* VAR_TLS_AUTH_CLIENT_CERT */
VAR_TLS_AUTH_CLIENT_KEY = 355, /* VAR_TLS_AUTH_CLIENT_KEY */
VAR_TLS_AUTH_CLIENT_KEY_PW = 356, /* VAR_TLS_AUTH_CLIENT_KEY_PW */
VAR_PATTERN = 357, /* VAR_PATTERN */
VAR_NAME = 358, /* VAR_NAME */
VAR_ZONEFILE = 359, /* VAR_ZONEFILE */
VAR_NOTIFY = 360, /* VAR_NOTIFY */
VAR_PROVIDE_XFR = 361, /* VAR_PROVIDE_XFR */
VAR_ALLOW_QUERY = 362, /* VAR_ALLOW_QUERY */
VAR_AXFR = 363, /* VAR_AXFR */
VAR_UDP = 364, /* VAR_UDP */
VAR_NOTIFY_RETRY = 365, /* VAR_NOTIFY_RETRY */
VAR_ALLOW_NOTIFY = 366, /* VAR_ALLOW_NOTIFY */
VAR_REQUEST_XFR = 367, /* VAR_REQUEST_XFR */
VAR_ALLOW_AXFR_FALLBACK = 368, /* VAR_ALLOW_AXFR_FALLBACK */
VAR_OUTGOING_INTERFACE = 369, /* VAR_OUTGOING_INTERFACE */
VAR_ANSWER_COOKIE = 370, /* VAR_ANSWER_COOKIE */
VAR_COOKIE_SECRET = 371, /* VAR_COOKIE_SECRET */
VAR_COOKIE_SECRET_FILE = 372, /* VAR_COOKIE_SECRET_FILE */
VAR_MAX_REFRESH_TIME = 373, /* VAR_MAX_REFRESH_TIME */
VAR_MIN_REFRESH_TIME = 374, /* VAR_MIN_REFRESH_TIME */
VAR_MAX_RETRY_TIME = 375, /* VAR_MAX_RETRY_TIME */
VAR_MIN_RETRY_TIME = 376, /* VAR_MIN_RETRY_TIME */
VAR_MIN_EXPIRE_TIME = 377, /* VAR_MIN_EXPIRE_TIME */
VAR_MULTI_MASTER_CHECK = 378, /* VAR_MULTI_MASTER_CHECK */
VAR_SIZE_LIMIT_XFR = 379, /* VAR_SIZE_LIMIT_XFR */
VAR_ZONESTATS = 380, /* VAR_ZONESTATS */
VAR_INCLUDE_PATTERN = 381, /* VAR_INCLUDE_PATTERN */
VAR_STORE_IXFR = 382, /* VAR_STORE_IXFR */
VAR_IXFR_SIZE = 383, /* VAR_IXFR_SIZE */
VAR_IXFR_NUMBER = 384, /* VAR_IXFR_NUMBER */
VAR_CREATE_IXFR = 385, /* VAR_CREATE_IXFR */
VAR_ZONE = 386, /* VAR_ZONE */
VAR_RRL_WHITELIST = 387, /* VAR_RRL_WHITELIST */
VAR_SERVERS = 388, /* VAR_SERVERS */
VAR_BINDTODEVICE = 389, /* VAR_BINDTODEVICE */
VAR_SETFIB = 390, /* VAR_SETFIB */
VAR_VERIFY = 391, /* VAR_VERIFY */
VAR_ENABLE = 392, /* VAR_ENABLE */
VAR_VERIFY_ZONE = 393, /* VAR_VERIFY_ZONE */
VAR_VERIFY_ZONES = 394, /* VAR_VERIFY_ZONES */
VAR_VERIFIER = 395, /* VAR_VERIFIER */
VAR_VERIFIER_COUNT = 396, /* VAR_VERIFIER_COUNT */
VAR_VERIFIER_FEED_ZONE = 397, /* VAR_VERIFIER_FEED_ZONE */
VAR_VERIFIER_TIMEOUT = 398 /* VAR_VERIFIER_TIMEOUT */
};
typedef enum yytokentype yytoken_kind_t;
#endif
@ -257,79 +264,86 @@ extern int c_debug;
#define VAR_TLS_SERVICE_OCSP 316
#define VAR_TLS_PORT 317
#define VAR_TLS_CERT_BUNDLE 318
#define VAR_CPU_AFFINITY 319
#define VAR_XFRD_CPU_AFFINITY 320
#define VAR_SERVER_CPU_AFFINITY 321
#define VAR_DROP_UPDATES 322
#define VAR_XFRD_TCP_MAX 323
#define VAR_XFRD_TCP_PIPELINE 324
#define VAR_DNSTAP 325
#define VAR_DNSTAP_ENABLE 326
#define VAR_DNSTAP_SOCKET_PATH 327
#define VAR_DNSTAP_SEND_IDENTITY 328
#define VAR_DNSTAP_SEND_VERSION 329
#define VAR_DNSTAP_IDENTITY 330
#define VAR_DNSTAP_VERSION 331
#define VAR_DNSTAP_LOG_AUTH_QUERY_MESSAGES 332
#define VAR_DNSTAP_LOG_AUTH_RESPONSE_MESSAGES 333
#define VAR_REMOTE_CONTROL 334
#define VAR_CONTROL_ENABLE 335
#define VAR_CONTROL_INTERFACE 336
#define VAR_CONTROL_PORT 337
#define VAR_SERVER_KEY_FILE 338
#define VAR_SERVER_CERT_FILE 339
#define VAR_CONTROL_KEY_FILE 340
#define VAR_CONTROL_CERT_FILE 341
#define VAR_KEY 342
#define VAR_ALGORITHM 343
#define VAR_SECRET 344
#define VAR_TLS_AUTH 345
#define VAR_TLS_AUTH_DOMAIN_NAME 346
#define VAR_TLS_AUTH_CLIENT_CERT 347
#define VAR_TLS_AUTH_CLIENT_KEY 348
#define VAR_TLS_AUTH_CLIENT_KEY_PW 349
#define VAR_PATTERN 350
#define VAR_NAME 351
#define VAR_ZONEFILE 352
#define VAR_NOTIFY 353
#define VAR_PROVIDE_XFR 354
#define VAR_ALLOW_QUERY 355
#define VAR_AXFR 356
#define VAR_UDP 357
#define VAR_NOTIFY_RETRY 358
#define VAR_ALLOW_NOTIFY 359
#define VAR_REQUEST_XFR 360
#define VAR_ALLOW_AXFR_FALLBACK 361
#define VAR_OUTGOING_INTERFACE 362
#define VAR_ANSWER_COOKIE 363
#define VAR_COOKIE_SECRET 364
#define VAR_COOKIE_SECRET_FILE 365
#define VAR_MAX_REFRESH_TIME 366
#define VAR_MIN_REFRESH_TIME 367
#define VAR_MAX_RETRY_TIME 368
#define VAR_MIN_RETRY_TIME 369
#define VAR_MIN_EXPIRE_TIME 370
#define VAR_MULTI_MASTER_CHECK 371
#define VAR_SIZE_LIMIT_XFR 372
#define VAR_ZONESTATS 373
#define VAR_INCLUDE_PATTERN 374
#define VAR_STORE_IXFR 375
#define VAR_IXFR_SIZE 376
#define VAR_IXFR_NUMBER 377
#define VAR_CREATE_IXFR 378
#define VAR_ZONE 379
#define VAR_RRL_WHITELIST 380
#define VAR_SERVERS 381
#define VAR_BINDTODEVICE 382
#define VAR_SETFIB 383
#define VAR_VERIFY 384
#define VAR_ENABLE 385
#define VAR_VERIFY_ZONE 386
#define VAR_VERIFY_ZONES 387
#define VAR_VERIFIER 388
#define VAR_VERIFIER_COUNT 389
#define VAR_VERIFIER_FEED_ZONE 390
#define VAR_VERIFIER_TIMEOUT 391
#define VAR_PROXY_PROTOCOL_PORT 319
#define VAR_CPU_AFFINITY 320
#define VAR_XFRD_CPU_AFFINITY 321
#define VAR_SERVER_CPU_AFFINITY 322
#define VAR_DROP_UPDATES 323
#define VAR_XFRD_TCP_MAX 324
#define VAR_XFRD_TCP_PIPELINE 325
#define VAR_DNSTAP 326
#define VAR_DNSTAP_ENABLE 327
#define VAR_DNSTAP_SOCKET_PATH 328
#define VAR_DNSTAP_IP 329
#define VAR_DNSTAP_TLS 330
#define VAR_DNSTAP_TLS_SERVER_NAME 331
#define VAR_DNSTAP_TLS_CERT_BUNDLE 332
#define VAR_DNSTAP_TLS_CLIENT_KEY_FILE 333
#define VAR_DNSTAP_TLS_CLIENT_CERT_FILE 334
#define VAR_DNSTAP_SEND_IDENTITY 335
#define VAR_DNSTAP_SEND_VERSION 336
#define VAR_DNSTAP_IDENTITY 337
#define VAR_DNSTAP_VERSION 338
#define VAR_DNSTAP_LOG_AUTH_QUERY_MESSAGES 339
#define VAR_DNSTAP_LOG_AUTH_RESPONSE_MESSAGES 340
#define VAR_REMOTE_CONTROL 341
#define VAR_CONTROL_ENABLE 342
#define VAR_CONTROL_INTERFACE 343
#define VAR_CONTROL_PORT 344
#define VAR_SERVER_KEY_FILE 345
#define VAR_SERVER_CERT_FILE 346
#define VAR_CONTROL_KEY_FILE 347
#define VAR_CONTROL_CERT_FILE 348
#define VAR_KEY 349
#define VAR_ALGORITHM 350
#define VAR_SECRET 351
#define VAR_TLS_AUTH 352
#define VAR_TLS_AUTH_DOMAIN_NAME 353
#define VAR_TLS_AUTH_CLIENT_CERT 354
#define VAR_TLS_AUTH_CLIENT_KEY 355
#define VAR_TLS_AUTH_CLIENT_KEY_PW 356
#define VAR_PATTERN 357
#define VAR_NAME 358
#define VAR_ZONEFILE 359
#define VAR_NOTIFY 360
#define VAR_PROVIDE_XFR 361
#define VAR_ALLOW_QUERY 362
#define VAR_AXFR 363
#define VAR_UDP 364
#define VAR_NOTIFY_RETRY 365
#define VAR_ALLOW_NOTIFY 366
#define VAR_REQUEST_XFR 367
#define VAR_ALLOW_AXFR_FALLBACK 368
#define VAR_OUTGOING_INTERFACE 369
#define VAR_ANSWER_COOKIE 370
#define VAR_COOKIE_SECRET 371
#define VAR_COOKIE_SECRET_FILE 372
#define VAR_MAX_REFRESH_TIME 373
#define VAR_MIN_REFRESH_TIME 374
#define VAR_MAX_RETRY_TIME 375
#define VAR_MIN_RETRY_TIME 376
#define VAR_MIN_EXPIRE_TIME 377
#define VAR_MULTI_MASTER_CHECK 378
#define VAR_SIZE_LIMIT_XFR 379
#define VAR_ZONESTATS 380
#define VAR_INCLUDE_PATTERN 381
#define VAR_STORE_IXFR 382
#define VAR_IXFR_SIZE 383
#define VAR_IXFR_NUMBER 384
#define VAR_CREATE_IXFR 385
#define VAR_ZONE 386
#define VAR_RRL_WHITELIST 387
#define VAR_SERVERS 388
#define VAR_BINDTODEVICE 389
#define VAR_SETFIB 390
#define VAR_VERIFY 391
#define VAR_ENABLE 392
#define VAR_VERIFY_ZONE 393
#define VAR_VERIFY_ZONES 394
#define VAR_VERIFIER 395
#define VAR_VERIFIER_COUNT 396
#define VAR_VERIFIER_FEED_ZONE 397
#define VAR_VERIFIER_TIMEOUT 398
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
@ -346,7 +360,7 @@ union YYSTYPE
char **strv;
struct component *comp;
#line 350 "configparser.h"
#line 364 "configparser.h"
};
typedef union YYSTYPE YYSTYPE;

View File

@ -1,8 +1,8 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for NSD 4.6.0.
# Generated by GNU Autoconf 2.69 for NSD 4.8.0.
#
# Report bugs to <nsd-bugs@nlnetlabs.nl>.
# Report bugs to <https://github.com/NLnetLabs/nsd/issues or nsd-bugs@nlnetlabs.nl>.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@ -267,6 +267,7 @@ fi
$as_echo "$0: be upgraded to zsh 4.3.4 or later."
else
$as_echo "$0: Please tell bug-autoconf@gnu.org and
$0: https://github.com/NLnetLabs/nsd/issues or
$0: nsd-bugs@nlnetlabs.nl about your system, including any
$0: error possibly output before this message. Then install
$0: a modern shell, or manually run the script under such a
@ -580,9 +581,9 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='NSD'
PACKAGE_TARNAME='nsd'
PACKAGE_VERSION='4.6.0'
PACKAGE_STRING='NSD 4.6.0'
PACKAGE_BUGREPORT='nsd-bugs@nlnetlabs.nl'
PACKAGE_VERSION='4.8.0'
PACKAGE_STRING='NSD 4.8.0'
PACKAGE_BUGREPORT='https://github.com/NLnetLabs/nsd/issues or nsd-bugs@nlnetlabs.nl'
PACKAGE_URL=''
# Factoring default headers for most tests.
@ -653,8 +654,6 @@ zonelistfile
xfrdfile
zonesdir
piddir
dbdir
dbfile
pidfile
logfile
nsd_conf_file
@ -1328,7 +1327,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures NSD 4.6.0 to adapt to many kinds of systems.
\`configure' configures NSD 4.8.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1390,7 +1389,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of NSD 4.6.0:";;
short | recursive ) echo "Configuration of NSD 4.8.0:";;
esac
cat <<\_ACEOF
@ -1407,7 +1406,7 @@ Optional Features:
--enable-recvmmsg Enable recvmmsg and sendmmsg compilation, faster but
some kernel versions may have implementation
problems for IPv6
--enable-root-server Configure NSD as a root server
--enable-root-server Configure NSD as a root server (obsolete)
--disable-ipv6 Disables IPv6 support
--enable-bind8-stats Enables BIND8 like NSTATS & XSTATS and statistics in
nsd-control
@ -1441,7 +1440,7 @@ Optional Packages:
Pathname to the NSD configuration file
--with-logfile=path Pathname to the default log file
--with-pidfile=path Pathname to the NSD pidfile
--with-dbfile=path Pathname to the NSD database
--with-dbfile=path Pathname to the NSD database (obsolete)
--with-zonesdir=dir NSD default location for zone files
--with-xfrdfile=path Pathname to the NSD xfrd zone timer state file
--with-zonelistfile=path
@ -1500,7 +1499,7 @@ Some influential environment variables:
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
Report bugs to <nsd-bugs@nlnetlabs.nl>.
Report bugs to <https://github.com/NLnetLabs/nsd/issues or nsd-bugs@nlnetlabs.nl>.
_ACEOF
ac_status=$?
fi
@ -1563,7 +1562,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
NSD configure 4.6.0
NSD configure 4.8.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@ -1722,9 +1721,9 @@ $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
( $as_echo "## ------------------------------------ ##
## Report this to nsd-bugs@nlnetlabs.nl ##
## ------------------------------------ ##"
( $as_echo "## ------------------------------------------------------------------------------- ##
## Report this to https://github.com/NLnetLabs/nsd/issues or nsd-bugs@nlnetlabs.nl ##
## ------------------------------------------------------------------------------- ##"
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
@ -2272,7 +2271,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by NSD $as_me 4.6.0, which was
It was created by NSD $as_me 4.8.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@ -3985,25 +3984,10 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
#
# Determine location of nsd.db
#
dbfile=${dbdir}/nsd.db
# Check whether --with-dbfile was given.
if test "${with_dbfile+set}" = set; then :
withval=$with_dbfile; dbfile=$withval
fi
cat >>confdefs.h <<_ACEOF
#define DBFILE "`eval echo $dbfile`"
_ACEOF
if test -n "$dbfile"; then
dbdir=`dirname $dbfile`
withval=$with_dbfile;
fi
@ -4122,450 +4106,186 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; then :
case $ac_cv_prog_cc_stdc in #(
no) :
ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #(
*) :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
if ${ac_cv_prog_cc_c99+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test -z "$ac_cv_prog_CC"; then
ac_ct_CC=$CC
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
$as_echo "$ac_ct_CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$ac_ct_CC" = x; then
CC=""
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
fi
else
CC="$ac_cv_prog_CC"
fi
if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
set dummy ${ac_tool_prefix}cc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
fi
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
ac_prog_rejected=no
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
fi
ac_cv_prog_CC="cc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
if test $ac_prog_rejected = yes; then
# We found a bogon in the path, so make sure we never use it.
set dummy $ac_cv_prog_CC
shift
if test $# != 0; then
# We chose a different compiler from the bogus one.
# However, it has the same basename, so the bogon will be chosen
# first if we set CC to just the basename; use the full file name.
shift
ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
fi
fi
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
for ac_prog in cl.exe
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$CC" && break
done
fi
if test -z "$CC"; then
ac_ct_CC=$CC
for ac_prog in cl.exe
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
$as_echo "$ac_ct_CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$ac_ct_CC" && break
done
if test "x$ac_ct_CC" = x; then
CC=""
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
fi
fi
fi
test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "no acceptable C compiler found in \$PATH
See \`config.log' for more details" "$LINENO" 5; }
# Provide some information about the compiler.
$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
set X $ac_compile
ac_compiler=$2
for ac_option in --version -v -V -qversion; do
{ { ac_try="$ac_compiler $ac_option >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_compiler $ac_option >&5") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
sed '10a\
... rest of stderr output deleted ...
10q' conftest.err >conftest.er1
cat conftest.er1 >&5
fi
rm -f conftest.er1 conftest.err
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
if ${ac_cv_c_compiler_gnu+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
ac_cv_prog_cc_c99=no
ac_save_CC=$CC
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
#include <wchar.h>
#include <stdio.h>
int
main ()
// Check varargs macros. These examples are taken from C99 6.10.3.5.
#define debug(...) fprintf (stderr, __VA_ARGS__)
#define showlist(...) puts (#__VA_ARGS__)
#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
static void
test_varargs_macros (void)
{
#ifndef __GNUC__
choke me
int x = 1234;
int y = 5678;
debug ("Flag");
debug ("X = %d\n", x);
showlist (The first, second, and third items.);
report (x>y, "x is %d but y is %d", x, y);
}
// Check long long types.
#define BIG64 18446744073709551615ull
#define BIG32 4294967295ul
#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
#if !BIG_OK
your preprocessor is broken;
#endif
#if BIG_OK
#else
your preprocessor is broken;
#endif
static long long int bignum = -9223372036854775807LL;
static unsigned long long int ubignum = BIG64;
;
struct incomplete_array
{
int datasize;
double data[];
};
struct named_init {
int number;
const wchar_t *name;
double average;
};
typedef const char *ccp;
static inline int
test_restrict (ccp restrict text)
{
// See if C++-style comments work.
// Iterate through items via the restricted pointer.
// Also check for declarations in for loops.
for (unsigned int i = 0; *(text+i) != '\0'; ++i)
continue;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_compiler_gnu=yes
else
ac_compiler_gnu=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
$as_echo "$ac_cv_c_compiler_gnu" >&6; }
if test $ac_compiler_gnu = yes; then
GCC=yes
else
GCC=
fi
ac_test_CFLAGS=${CFLAGS+set}
ac_save_CFLAGS=$CFLAGS
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
$as_echo_n "checking whether $CC accepts -g... " >&6; }
if ${ac_cv_prog_cc_g+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_save_c_werror_flag=$ac_c_werror_flag
ac_c_werror_flag=yes
ac_cv_prog_cc_g=no
CFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
// Check varargs and va_copy.
static void
test_varargs (const char *format, ...)
{
va_list args;
va_start (args, format);
va_list args_copy;
va_copy (args_copy, args);
const char *str;
int number;
float fnumber;
while (*format)
{
switch (*format++)
{
case 's': // string
str = va_arg (args_copy, const char *);
break;
case 'd': // int
number = va_arg (args_copy, int);
break;
case 'f': // float
fnumber = va_arg (args_copy, double);
break;
default:
break;
}
}
va_end (args_copy);
va_end (args);
}
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_g=yes
else
CFLAGS=""
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
// Check bool.
_Bool success = false;
int
main ()
{
// Check restrict.
if (test_restrict ("String literal") == 0)
success = true;
char *restrict newvar = "Another string";
// Check varargs.
test_varargs ("s, d' f .", "string", 65, 34.234);
test_varargs_macros ();
// Check flexible array members.
struct incomplete_array *ia =
malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
ia->datasize = 10;
for (int i = 0; i < ia->datasize; ++i)
ia->data[i] = i * 1.234;
// Check named initializers.
struct named_init ni = {
.number = 34,
.name = L"Test wide string",
.average = 543.34343,
};
ni.number = 58;
int dynamic_array[ni.number];
dynamic_array[ni.number - 1] = 543;
// work around unused variable warnings
return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
|| dynamic_array[ni.number - 1] != 543);
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99
do
CC="$ac_save_CC $ac_arg"
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_c99=$ac_arg
fi
rm -f core conftest.err conftest.$ac_objext
test "x$ac_cv_prog_cc_c99" != "xno" && break
done
rm -f conftest.$ac_ext
CC=$ac_save_CC
fi
# AC_CACHE_VAL
case "x$ac_cv_prog_cc_c99" in
x)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
$as_echo "none needed" >&6; } ;;
xno)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
$as_echo "unsupported" >&6; } ;;
*)
CC="$CC $ac_cv_prog_cc_c99"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
esac
if test "x$ac_cv_prog_cc_c99" != xno; then :
ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
else
ac_c_werror_flag=$ac_save_c_werror_flag
CFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_g=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_c_werror_flag=$ac_save_c_werror_flag
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
$as_echo "$ac_cv_prog_cc_g" >&6; }
if test "$ac_test_CFLAGS" = set; then
CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
if test "$GCC" = yes; then
CFLAGS="-g -O2"
else
CFLAGS="-g"
fi
else
if test "$GCC" = yes; then
CFLAGS="-O2"
else
CFLAGS=
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
if ${ac_cv_prog_cc_c89+:} false; then :
$as_echo_n "(cached) " >&6
@ -4652,14 +4372,31 @@ $as_echo "unsupported" >&6; } ;;
$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
esac
if test "x$ac_cv_prog_cc_c89" != xno; then :
ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
else
ac_cv_prog_cc_stdc=no
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5
$as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; }
if ${ac_cv_prog_cc_stdc+:} false; then :
$as_echo_n "(cached) " >&6
fi
case $ac_cv_prog_cc_stdc in #(
no) :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
$as_echo "unsupported" >&6; } ;; #(
'') :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
$as_echo "none needed" >&6; } ;; #(
*) :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5
$as_echo "$ac_cv_prog_cc_stdc" >&6; } ;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
$as_echo_n "checking for a sed that does not truncate output... " >&6; }
@ -6521,10 +6258,7 @@ fi
$as_echo_n "checking whether strptime works... " >&6; }
if test c${cross_compiling} = cno; then
if test "$cross_compiling" = yes; then :
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot run test program while cross compiling
See \`config.log' for more details" "$LINENO" 5; }
eval "ac_cv_c_strptime_works=maybe"
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@ -6593,6 +6327,9 @@ else
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
@ -8301,6 +8038,9 @@ else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/socket.h>
#include <errno.h>
int main(void)
@ -8337,6 +8077,9 @@ else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/socket.h>
#include <errno.h>
int main(void)
@ -9026,17 +8769,6 @@ if test "${enable_root_server+set}" = set; then :
enableval=$enable_root_server;
fi
case "$enable_root_server" in
yes)
cat >>confdefs.h <<_ACEOF
#define ROOT_SERVER /**/
_ACEOF
;;
no|*)
;;
esac
# Check whether --enable-ipv6 was given.
if test "${enable_ipv6+set}" = set; then :
@ -9111,7 +8843,7 @@ if eval \${cv_prog_cc_flag_$cache+:} false; then :
$as_echo_n "(cached) " >&6
else
echo 'void f(){}' >conftest.c
echo 'void f(void){}' >conftest.c
if test -z "`$CC -W -c conftest.c 2>&1`"; then
eval "cv_prog_cc_flag_$cache=yes"
else
@ -9142,7 +8874,7 @@ if eval \${cv_prog_cc_flag_$cache+:} false; then :
$as_echo_n "(cached) " >&6
else
echo 'void f(){}' >conftest.c
echo 'void f(void){}' >conftest.c
if test -z "`$CC -Wall -c conftest.c 2>&1`"; then
eval "cv_prog_cc_flag_$cache=yes"
else
@ -9173,7 +8905,7 @@ if eval \${cv_prog_cc_flag_$cache+:} false; then :
$as_echo_n "(cached) " >&6
else
echo 'void f(){}' >conftest.c
echo 'void f(void){}' >conftest.c
if test -z "`$CC -Wextra -c conftest.c 2>&1`"; then
eval "cv_prog_cc_flag_$cache=yes"
else
@ -9204,7 +8936,7 @@ if eval \${cv_prog_cc_flag_$cache+:} false; then :
$as_echo_n "(cached) " >&6
else
echo 'void f(){}' >conftest.c
echo 'void f(void){}' >conftest.c
if test -z "`$CC -Wdeclaration-after-statement -c conftest.c 2>&1`"; then
eval "cv_prog_cc_flag_$cache=yes"
else
@ -9616,7 +9348,7 @@ else
echo '
#include <openssl/sha.h>
' >conftest.c
echo 'void f(){ (void)SHA1_Init(NULL); }' >>conftest.c
echo 'void f(void){ (void)SHA1_Init(NULL); }' >>conftest.c
if test -z "`$CC $CPPFLAGS $CFLAGS -c conftest.c 2>&1 | grep -e deprecated -e unavailable`"; then
eval "cv_cc_deprecated_$cache=no"
else
@ -9744,7 +9476,7 @@ else
echo '
#include <openssl/ssl.h>
' >conftest.c
echo 'void f(){ (void)ERR_load_SSL_strings(); }' >>conftest.c
echo 'void f(void){ (void)ERR_load_SSL_strings(); }' >>conftest.c
if test -z "`$CC $CPPFLAGS $CFLAGS -c conftest.c 2>&1 | grep -e deprecated -e unavailable`"; then
eval "cv_cc_deprecated_$cache=no"
else
@ -9775,8 +9507,6 @@ fi
LIBS="$BAKLIBS"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No SSL, therefore remote-control is disabled" >&5
$as_echo "$as_me: WARNING: No SSL, therefore remote-control is disabled" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No SSL, therefore TLS is disabled" >&5
$as_echo "$as_me: WARNING: No SSL, therefore TLS is disabled" >&2;}
fi
@ -11105,7 +10835,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by NSD $as_me 4.6.0, which was
This file was extended by NSD $as_me 4.8.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -11161,13 +10891,13 @@ $config_files
Configuration headers:
$config_headers
Report bugs to <nsd-bugs@nlnetlabs.nl>."
Report bugs to <https://github.com/NLnetLabs/nsd/issues or nsd-bugs@nlnetlabs.nl>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
NSD config.status 4.6.0
NSD config.status 4.8.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

View File

@ -5,7 +5,7 @@ dnl
sinclude(acx_nlnetlabs.m4)
sinclude(dnstap/dnstap.m4)
AC_INIT([NSD],[4.6.0],[nsd-bugs@nlnetlabs.nl])
AC_INIT([NSD],[4.8.0],[https://github.com/NLnetLabs/nsd/issues or nsd-bugs@nlnetlabs.nl])
AC_CONFIG_HEADERS([config.h])
#
@ -96,20 +96,8 @@ AC_ARG_WITH([pidfile],
AC_SUBST(pidfile)
AC_DEFINE_UNQUOTED(PIDFILE, ["`eval echo $pidfile`"], [Pathname to the NSD pidfile])
#
# Determine location of nsd.db
#
dbfile=${dbdir}/nsd.db
AC_ARG_WITH([dbfile],
AS_HELP_STRING([--with-dbfile=path],[Pathname to the NSD database]),
[dbfile=$withval])
AC_SUBST(dbfile)
AC_DEFINE_UNQUOTED(DBFILE, ["`eval echo $dbfile`"], [Pathname to the NSD database])
if test -n "$dbfile"; then
dbdir=`dirname $dbfile`
fi
AC_SUBST(dbdir)
AS_HELP_STRING([--with-dbfile=path],[Pathname to the NSD database (obsolete)]),[])
piddir=`dirname $pidfile`
AC_SUBST(piddir)
@ -174,7 +162,7 @@ AC_ARG_WITH([user],
AC_SUBST(user)
AC_DEFINE_UNQUOTED(USER, ["$user"], [the user name to drop privileges to])
AC_PROG_CC
m4_version_prereq([2.70], [AC_PROG_CC], [AC_PROG_CC_STDC])
AC_PROG_SED
AC_PROG_AWK
AC_PROG_GREP
@ -296,7 +284,7 @@ AC_MSG_CHECKING(whether $CC supports -$1)
cache=`echo $1 | $SED 'y%.=/+-%___p_%'`
AC_CACHE_VAL(cv_prog_cc_flag_$cache,
[
echo 'void f(){}' >conftest.c
echo 'void f(void){}' >conftest.c
if test -z "`$CC -$1 -c conftest.c 2>&1`"; then
eval "cv_prog_cc_flag_$cache=yes"
else
@ -569,7 +557,8 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[
int main(void) { struct tm tm; char *res;
res = strptime("20070207111842", "%Y%m%d%H%M%S", &tm);
if (!res) return 1; return 0; }
]])] , [eval "ac_cv_c_strptime_works=yes"], [eval "ac_cv_c_strptime_works=no"])
]])] , [eval "ac_cv_c_strptime_works=yes"], [eval "ac_cv_c_strptime_works=no"],
[eval "ac_cv_c_strptime_works=maybe"])
else
eval "ac_cv_c_strptime_works=maybe"
fi
@ -698,6 +687,9 @@ case "$enable_recvmmsg" in
yes)
AC_CHECK_FUNC([recvmmsg], [
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/socket.h>
#include <errno.h>
int main(void)
@ -714,6 +706,9 @@ AC_DEFINE([HAVE_RECVMMSG], [1], [Define if recvmmsg exists])]
)])
AC_CHECK_FUNC([sendmmsg], [
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/socket.h>
#include <errno.h>
int main(void)
@ -932,14 +927,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
@ -1089,7 +1077,6 @@ AC_INCLUDES_DEFAULT
LIBS="$BAKLIBS"
else
AC_MSG_WARN([No SSL, therefore remote-control is disabled])
AC_MSG_WARN([No SSL, therefore TLS is disabled])
fi
@ -1230,6 +1217,7 @@ AH_BOTTOM([
#include <sys/types.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#ifdef HAVE_TIME_H
#include <time.h>

View File

@ -1,6 +0,0 @@
[Socket]
ListenDatagram=127.0.0.1:1153
ListenStream=127.0.0.1:1153
# ListenStream=/usr/local/etc/nsd/control
[Install]
WantedBy=sockets.target

View File

@ -21,7 +21,7 @@
1.0 Introduction
This is NSD Name Server Daemon (NSD) version 4.6.0.
This is NSD Name Server Daemon (NSD) version 4.8.0.
The NLnet Labs Name Server Daemon (NSD) is an authoritative RFC compliant
DNS nameserver. It was first conceived to allow for more genetic
@ -57,7 +57,7 @@ and uses a simple configuration file 'nsd.conf'.
1.2 Quick build and install
Step 1: Unpack the source with gtar -xzvf nsd-4.6.0.tar.gz
Step 1: Unpack the source with gtar -xzvf nsd-4.8.0.tar.gz
Step 2: Create user nsd or any other unprivileged user of your
choice. In case of later make sure to use
@ -111,9 +111,9 @@ Step 11: If desired add 'nsd-control write' to your superuser crontab to
Use your favorite combination of tar and gnu zip to unpack the source,
for example
$ gtar -xzvf nsd-4.6.0.tar.gz
$ gtar -xzvf nsd-4.8.0.tar.gz
will unpack the source into the ./nsd-4.6.0 directory...
will unpack the source into the ./nsd-4.8.0 directory...
2.2 Configuring NSD
@ -194,10 +194,6 @@ addition to standard configure options, one may use the following:
Pathname to the NSD pidfile, default is platform specific,
mostly /var/run/nsd.pid
--with-dbfile=path
Pathname to the NSD database, default is /etc/nsd/nsd.db
--with-zonesdir=dir
NSD default location for master zone files, default /etc/nsd/
@ -875,7 +871,7 @@ offered through a mailing lists and the 'bugzilla' web interface.
If for any reason NLnet Labs would stop community support of NSD such
would be announced on our web pages at least two years in advance.
The community mailing list nsd-users@nlnetlabs.nl can be used to discuss
The community mailing list nsd-users@lists.NLnetLabs.nl can be used to discuss
issues with other users of NSD. Subscribe here
http://lists.nlnetlabs.nl/mailman/listinfo/nsd-users
@ -885,9 +881,7 @@ community support is not sufficient and that support needs to be codified.
We therefore offer paid support contracts that come in 3 varieties.
More information about these support varieties can be found at
<url on support varieties on www.nlnetlabs.nl>
Alternatively you can contact mailto:nsd-support@nlnetlabs.nl .
https://nlnetlabs.nl/services/contracts/
Support goes two ways. By acquiring one of the support contracts you
also support NLnet Labs to continue to participate in the development
@ -896,11 +890,10 @@ the (IETF) standards process and by developing and maintaining
reference implementations of standards and tools to support operation
and deployment of new and existing Internet technology.
We are interested in our users and in the environment you use NSD. Please
drop us a mail when you use NSD. Indicate in what kind of operation you
deploy NSD and let us know what your positive and negative experiences are.
http://www.nlnetlabs.nl/nsd and mailto:nsd-info@nlnetlabs.nl
We are interested in our users and in the environment you use NSD. Please drop
us a mail when you use NSD at users@NLnetLabs.nl. Indicate in what kind of
operation you deploy NSD and let us know what your positive and negative
experiences are.
4.1 Your Support
@ -926,5 +919,3 @@ that by giving us a donation. For small donations PayPal can be used. For
larger and regular donations please contact us at users@NLnetLabs.nl. Also
see http://www.nlnetlabs.nl/labs/contributors/.
$Id: README,v 1.2 2022/09/24 17:38:17 christos Exp $

View File

@ -66,7 +66,6 @@ nsd_options_create(region_type* region)
opt->drop_updates = 0;
opt->do_ip4 = 1;
opt->do_ip6 = 1;
opt->database = DBFILE;
opt->identity = 0;
opt->version = 0;
opt->nsid = 0;
@ -117,6 +116,12 @@ nsd_options_create(region_type* region)
#ifdef USE_DNSTAP
opt->dnstap_enable = 0;
opt->dnstap_socket_path = DNSTAP_SOCKET_PATH;
opt->dnstap_ip = "";
opt->dnstap_tls = 1;
opt->dnstap_tls_server_name = NULL;
opt->dnstap_tls_cert_bundle = NULL;
opt->dnstap_tls_client_key_file = NULL;
opt->dnstap_tls_client_cert_file = NULL;
opt->dnstap_send_identity = 0;
opt->dnstap_send_version = 0;
opt->dnstap_identity = NULL;
@ -125,15 +130,14 @@ nsd_options_create(region_type* region)
opt->dnstap_log_auth_response_messages = 0;
#endif
opt->zonefiles_check = 1;
if(opt->database == NULL || opt->database[0] == 0)
opt->zonefiles_write = ZONEFILES_WRITE_INTERVAL;
else opt->zonefiles_write = 0;
opt->zonefiles_write = ZONEFILES_WRITE_INTERVAL;
opt->xfrd_reload_timeout = 1;
opt->tls_service_key = NULL;
opt->tls_service_ocsp = NULL;
opt->tls_service_pem = NULL;
opt->tls_port = TLS_PORT;
opt->tls_cert_bundle = NULL;
opt->proxy_protocol_port = NULL;
opt->answer_cookie = 0;
opt->cookie_secret = NULL;
opt->cookie_secret_file = CONFIGDIR"/nsd_cookiesecrets.txt";
@ -1674,6 +1678,32 @@ key_options_add_modify(struct nsd_options* opt, struct key_options* key)
}
}
int
acl_check_incoming_block_proxy(struct acl_options* acl, struct query* q,
struct acl_options** reason)
{
/* check each acl element.
* if it is blocked, return -1.
* return false if no matches for blocked elements. */
if(reason)
*reason = NULL;
while(acl)
{
DEBUG(DEBUG_XFRD,2, (LOG_INFO, "proxy testing acl %s %s",
acl->ip_address_spec, acl->nokey?"NOKEY":
(acl->blocked?"BLOCKED":acl->key_name)));
if(acl_addr_matches_proxy(acl, q) && acl->blocked) {
if(reason)
*reason = acl;
return -1;
}
acl = acl->next;
}
return 0;
}
int
acl_check_incoming(struct acl_options* acl, struct query* q,
struct acl_options** reason)
@ -1801,7 +1831,7 @@ acl_addr_matches(struct acl_options* acl, struct query* q)
if(acl->is_ipv6)
{
#ifdef INET6
struct sockaddr_storage* addr = (struct sockaddr_storage*)&q->addr;
struct sockaddr_storage* addr = (struct sockaddr_storage*)&q->client_addr;
if(addr->ss_family != AF_INET6)
return 0;
return acl_addr_matches_ipv6host(acl, addr, ntohs(((struct sockaddr_in6*)addr)->sin6_port));
@ -1811,7 +1841,32 @@ acl_addr_matches(struct acl_options* acl, struct query* q)
}
else
{
struct sockaddr_in* addr = (struct sockaddr_in*)&q->addr;
struct sockaddr_in* addr = (struct sockaddr_in*)&q->client_addr;
if(addr->sin_family != AF_INET)
return 0;
return acl_addr_matches_ipv4host(acl, addr, ntohs(addr->sin_port));
}
/* ENOTREACH */
return 0;
}
int
acl_addr_matches_proxy(struct acl_options* acl, struct query* q)
{
if(acl->is_ipv6)
{
#ifdef INET6
struct sockaddr_storage* addr = (struct sockaddr_storage*)&q->remote_addr;
if(addr->ss_family != AF_INET6)
return 0;
return acl_addr_matches_ipv6host(acl, addr, ntohs(((struct sockaddr_in6*)addr)->sin6_port));
#else
return 0; /* no inet6, no match */
#endif
}
else
{
struct sockaddr_in* addr = (struct sockaddr_in*)&q->remote_addr;
if(addr->sin_family != AF_INET)
return 0;
return acl_addr_matches_ipv4host(acl, addr, ntohs(addr->sin_port));
@ -2572,3 +2627,36 @@ resolve_interface_names(struct nsd_options* options)
(void)options;
#endif /* HAVE_GETIFADDRS */
}
int
sockaddr_uses_proxy_protocol_port(struct nsd_options* options,
struct sockaddr* addr)
{
struct proxy_protocol_port_list* p;
int port;
#ifdef INET6
struct sockaddr_storage* ss = (struct sockaddr_storage*)addr;
if(ss->ss_family == AF_INET6) {
struct sockaddr_in6* a6 = (struct sockaddr_in6*)addr;
port = ntohs(a6->sin6_port);
} else if(ss->ss_family == AF_INET) {
#endif
struct sockaddr_in* a = (struct sockaddr_in*)addr;
#ifndef INET6
if(a->sin_family != AF_INET)
return 0; /* unknown family */
#endif
port = ntohs(a->sin_port);
#ifdef INET6
} else {
return 0; /* unknown family */
}
#endif
p = options->proxy_protocol_port;
while(p) {
if(p->port == port)
return 1;
p = p->next;
}
return 0;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,245 +0,0 @@
/*
* udbradtree -- radix tree for binary strings for in udb file.
*
* Copyright (c) 2011, NLnet Labs. See LICENSE for license.
*/
#ifndef UDB_RADTREE_H
#define UDB_RADTREE_H
#include "udb.h"
struct udb_radnode;
/** length of the binary string */
typedef uint16_t udb_radstrlen_type;
/**
* The radix tree
*
* The elements are stored based on binary strings(0-255) of a given length.
* They are sorted, a prefix is sorted before its suffixes.
* If you want to know the key string, you should store it yourself, the
* tree stores it in the parts necessary for lookup.
* For binary strings for domain names see the radname routines.
*
* This is the tree on disk representation. It has _d suffix in the name
* to help delineate disk structures from normal structures.
*/
struct udb_radtree_d {
/** root node in tree, to udb_radnode_d */
struct udb_rel_ptr root;
/** count of number of elements */
uint64_t count;
};
/**
* A radix tree lookup node. It is stored on disk, and the lookup array
* is allocated.
*/
struct udb_radnode_d {
/** data element associated with the binary string up to this node */
struct udb_rel_ptr elem;
/** parent node (NULL for the root), to udb_radnode_d */
struct udb_rel_ptr parent;
/** the array structure, for lookup by [byte-offset]. udb_radarray_d */
struct udb_rel_ptr lookup;
/** index in the parent lookup array */
uint8_t pidx;
/** offset of the lookup array, add to [i] for lookups */
uint8_t offset;
};
/**
* radix select edge in array
* The string for this element is the Nth string in the stringarray.
*/
struct udb_radsel_d {
/** length of the additional string for this edge,
* additional string after the selection-byte for this edge.*/
udb_radstrlen_type len;
/** padding for non64bit compilers to 64bit boundaries, to make
* the udb file more portable, without this the file would work
* on the system it is created on (which is what we promise), but
* with this, you have a chance of it working on other platforms */
uint16_t padding16;
uint32_t padding32;
/** node that deals with byte+str, to udb_radnode_d */
struct udb_rel_ptr node;
};
/**
* Array of radsel elements.
* This is the header, the array is allocated contiguously behind it.
* The strings (often very short) are allocated behind the array.
* All strings are given the same amount of space (str_cap),
* so there is capacity*str_cap bytes at the end.
*/
struct udb_radarray_d {
/** length of the lookup array */
uint16_t len;
/** capacity of the lookup array (can be larger than length) */
uint16_t capacity;
/** space capacity of for every string */
udb_radstrlen_type str_cap;
/** padding to 64bit alignment, just in case compiler goes mad */
uint16_t padding;
/** the elements (allocated contiguously after this structure) */
struct udb_radsel_d array[0];
};
/**
* Create new radix tree on udb storage
* @param udb: the udb to allocate space on.
* @param ptr: ptr to the udbradtree is returned here. Pass uninitialised.
* type is udb_radtree_d.
* @return 0 on alloc failure.
*/
int udb_radix_tree_create(udb_base* udb, udb_ptr* ptr);
/**
* Delete intermediate nodes from radix tree
* @param udb: the udb.
* @param rt: radix tree to be cleared. type udb_radtree_d.
*/
void udb_radix_tree_clear(udb_base* udb, udb_ptr* rt);
/**
* Delete radix tree.
* You must have deleted the elements, this deletes the nodes.
* @param udb: the udb.
* @param rt: radix tree to be deleted. type udb_radtree_d.
*/
void udb_radix_tree_delete(udb_base* udb, udb_ptr* rt);
/**
* Insert element into radix tree.
* @param udb: the udb.
* @param rt: the radix tree, type udb_radtree_d.
* @param key: key string.
* @param len: length of key.
* @param elem: pointer to element data, on the udb store.
* @param result: the inserted node is set to this value. Pass uninitialised.
Not set if the routine fails.
* @return NULL on failure - out of memory.
* NULL on failure - duplicate entry.
* On success the new radix node for this element (udb_radnode_d).
*/
udb_void udb_radix_insert(udb_base* udb, udb_ptr* rt, uint8_t* k,
udb_radstrlen_type len, udb_ptr* elem, udb_ptr* result);
/**
* Delete element from radix tree.
* @param udb: the udb.
* @param rt: the radix tree. type udb_radtree_d
* @param n: radix node for that element. type udb_radnode_d
* if NULL, nothing is deleted.
*/
void udb_radix_delete(udb_base* udb, udb_ptr* rt, udb_ptr* n);
/**
* Find radix element in tree.
* @param rt: the radix tree, type udb_radtree_d.
* @param key: key string.
* @param len: length of key.
* @return the radix node or NULL if not found. type udb_radnode_d
*/
udb_void udb_radix_search(udb_ptr* rt, uint8_t* k,
udb_radstrlen_type len);
/**
* Find radix element in tree, and if not found, find the closest smaller or
* equal element in the tree.
* @param udb: the udb.
* @param rt: the radix tree, type udb_radtree_d.
* @param key: key string.
* @param len: length of key.
* @param result: returns the radix node or closest match (NULL if key is
* smaller than the smallest key in the tree). type udb_radnode_d.
* you can pass an uninitialized ptr, an unlinked or a zeroed one.
* @return true if exact match, false if no match.
*/
int udb_radix_find_less_equal(udb_base* udb, udb_ptr* rt, uint8_t* k,
udb_radstrlen_type len, udb_ptr* result);
/**
* Return the first (smallest) element in the tree.
* @param udb: the udb.
* @param rt: the radix tree, type udb_radtree_d.
* @param p: set to the first node in the tree, or NULL if none.
* type udb_radnode_d.
* pass uninitialised, zero or unlinked udb_ptr.
*/
void udb_radix_first(udb_base* udb, udb_ptr* rt, udb_ptr* p);
/**
* Return the last (largest) element in the tree.
* @param udb: the udb.
* @param rt: the radix tree, type udb_radtree_d.
* @param p: last node or NULL if none, type udb_radnode_d.
* pass uninitialised, zero or unlinked udb_ptr.
*/
void udb_radix_last(udb_base* udb, udb_ptr* rt, udb_ptr* p);
/**
* Return the next element.
* @param udb: the udb.
* @param n: adjusted to the next element, or NULL if none. type udb_radnode_d.
*/
void udb_radix_next(udb_base* udb, udb_ptr* n);
/**
* Return the previous element.
* @param udb: the udb.
* @param n: adjusted to the prev node or NULL if none. type udb_radnode_d.
*/
void udb_radix_prev(udb_base* udb, udb_ptr* n);
/*
* Perform a walk through all elements of the tree.
* node: variable of type struct radnode*.
* tree: pointer to the tree.
* for(udb_radix_first(tree, node); node->data; udb_radix_next(node))
*/
/** for use in udb-walkfunc, walks relptrs in udb_chunk_type_radtree */
void udb_radix_tree_walk_chunk(void* base, void* d, uint64_t s,
udb_walk_relptr_cb* cb, void* arg);
/** for use in udb-walkfunc, walks relptrs in udb_chunk_type_radnode */
void udb_radix_node_walk_chunk(void* base, void* d, uint64_t s,
udb_walk_relptr_cb* cb, void* arg);
/** for use in udb-walkfunc, walks relptrs in udb_chunk_type_radarray */
void udb_radix_array_walk_chunk(void* base, void* d, uint64_t s,
udb_walk_relptr_cb* cb, void* arg);
/** get the memory used by the lookup structure for a radnode */
size_t size_of_lookup_ext(udb_ptr* node);
/** insert radtree element, key is a domain name
* @param udb: udb.
* @param rt: the tree.
* @param dname: domain name in uncompressed wireformat.
* @param dlen: length of k.
* @param elem: element to store
* @param result: the inserted node is set to this value. Pass uninitialised.
Not set if the routine fails.
* @return 0 on failure
*/
udb_void udb_radname_insert(udb_base* udb, udb_ptr* rt, const uint8_t* dname,
size_t dlen, udb_ptr* elem, udb_ptr* result);
/** search for a radname element, key is a domain name.
* @param udb: udb
* @param rt: the tree
* @param dname: domain name in uncompressed wireformat.
* @param dlen: length of k.
* @param result: result ptr to store the node into.
* may be uninitialized.
* @return 0 if not found.
*/
int udb_radname_search(udb_base* udb, udb_ptr* rt, const uint8_t* dname,
size_t dlen, udb_ptr* result);
#define RADNODE(ptr) ((struct udb_radnode_d*)UDB_PTR(ptr))
#define RADTREE(ptr) ((struct udb_radtree_d*)UDB_PTR(ptr))
#endif /* UDB_RADTREE_H */

View File

@ -1,838 +0,0 @@
/*
* udbzone -- store zone and rrset information in udb file.
*
* Copyright (c) 2011, NLnet Labs. See LICENSE for license.
*/
#include "config.h"
#include "udbzone.h"
#include "util.h"
#include "iterated_hash.h"
#include "dns.h"
#include "dname.h"
#include "difffile.h"
#include <string.h>
/** delete the zone plain its own data */
static void
udb_zone_delete_plain(udb_base* udb, udb_ptr* zone)
{
udb_ptr dtree;
assert(udb_ptr_get_type(zone) == udb_chunk_type_zone);
udb_zone_clear(udb, zone);
udb_rptr_zero(&ZONE(zone)->node, udb);
udb_rptr_zero(&ZONE(zone)->nsec3param, udb);
udb_rptr_zero(&ZONE(zone)->log_str, udb);
udb_rptr_zero(&ZONE(zone)->file_str, udb);
udb_ptr_new(&dtree, udb, &ZONE(zone)->domains);
udb_rptr_zero(&ZONE(zone)->domains, udb);
udb_radix_tree_delete(udb, &dtree);
udb_ptr_free_space(zone, udb,
sizeof(struct zone_d)+ZONE(zone)->namelen);
}
int
udb_dns_init_file(udb_base* udb)
{
udb_ptr ztree;
if(!udb_radix_tree_create(udb, &ztree)) {
return 0;
}
udb_base_set_userdata(udb, ztree.data);
udb_ptr_unlink(&ztree, udb);
return 1;
}
void
udb_dns_deinit_file(udb_base* udb)
{
udb_ptr ztree;
udb_ptr z;
udb_ptr_new(&ztree, udb, udb_base_get_userdata(udb));
if(udb_ptr_is_null(&ztree)) {
return;
}
assert(udb_ptr_get_type(&ztree) == udb_chunk_type_radtree);
/* delete all zones */
for(udb_radix_first(udb, &ztree, &z); z.data; udb_radix_next(udb, &z)){
udb_ptr zone;
udb_ptr_new(&zone, udb, &RADNODE(&z)->elem);
udb_rptr_zero(&RADNODE(&z)->elem, udb);
udb_zone_delete_plain(udb, &zone);
}
udb_ptr_unlink(&z, udb);
udb_base_set_userdata(udb, 0);
udb_radix_tree_delete(udb, &ztree);
}
int
udb_zone_create(udb_base* udb, udb_ptr* result, const uint8_t* dname,
size_t dlen)
{
udb_ptr ztree, z, node, dtree;
udb_ptr_new(&ztree, udb, udb_base_get_userdata(udb));
assert(udb_ptr_get_type(&ztree) == udb_chunk_type_radtree);
udb_ptr_init(result, udb);
if(udb_zone_search(udb, &z, dname, dlen)) {
udb_ptr_unlink(&ztree, udb);
udb_ptr_unlink(&z, udb);
/* duplicate */
return 0;
}
if(!udb_ptr_alloc_space(&z, udb, udb_chunk_type_zone,
sizeof(struct zone_d)+dlen)) {
udb_ptr_unlink(&ztree, udb);
/* failed alloc */
return 0;
}
/* init the zone object */
udb_rel_ptr_init(&ZONE(&z)->node);
udb_rel_ptr_init(&ZONE(&z)->domains);
udb_rel_ptr_init(&ZONE(&z)->nsec3param);
udb_rel_ptr_init(&ZONE(&z)->log_str);
udb_rel_ptr_init(&ZONE(&z)->file_str);
ZONE(&z)->rrset_count = 0;
ZONE(&z)->rr_count = 0;
ZONE(&z)->expired = 0;
ZONE(&z)->mtime = 0;
ZONE(&z)->mtime_nsec = 0;
ZONE(&z)->namelen = dlen;
memmove(ZONE(&z)->name, dname, dlen);
if(!udb_radix_tree_create(udb, &dtree)) {
udb_ptr_free_space(&z, udb, sizeof(struct zone_d)+dlen);
udb_ptr_unlink(&ztree, udb);
/* failed alloc */
return 0;
}
udb_rptr_set_ptr(&ZONE(&z)->domains, udb, &dtree);
/* insert it */
if(!udb_radname_insert(udb, &ztree, dname, dlen, &z, &node)) {
udb_ptr_free_space(&z, udb, sizeof(struct zone_d)+dlen);
udb_ptr_unlink(&ztree, udb);
udb_radix_tree_delete(udb, &dtree);
udb_ptr_unlink(&dtree, udb);
/* failed alloc */
return 0;
}
udb_rptr_set_ptr(&ZONE(&z)->node, udb, &node);
udb_ptr_set_ptr(result, udb, &z);
udb_ptr_unlink(&z, udb);
udb_ptr_unlink(&dtree, udb);
udb_ptr_unlink(&ztree, udb);
udb_ptr_unlink(&node, udb);
return 1;
}
/** delete an RR */
static void
rr_delete(udb_base* udb, udb_ptr* rr)
{
assert(udb_ptr_get_type(rr) == udb_chunk_type_rr);
udb_rptr_zero(&RR(rr)->next, udb);
udb_ptr_free_space(rr, udb, sizeof(struct rr_d)+RR(rr)->len);
}
/** delete an rrset */
static void
rrset_delete(udb_base* udb, udb_ptr* rrset)
{
udb_ptr rr, n;
assert(udb_ptr_get_type(rrset) == udb_chunk_type_rrset);
/* free RRs */
udb_ptr_new(&rr, udb, &RRSET(rrset)->rrs);
udb_ptr_init(&n, udb);
udb_rptr_zero(&RRSET(rrset)->rrs, udb);
while(!udb_ptr_is_null(&rr)) {
udb_ptr_set_rptr(&n, udb, &RR(&rr)->next);
rr_delete(udb, &rr);
udb_ptr_set_ptr(&rr, udb, &n);
udb_ptr_zero(&n, udb);
}
udb_ptr_unlink(&n, udb);
udb_ptr_unlink(&rr, udb);
udb_rptr_zero(&RRSET(rrset)->next, udb);
udb_ptr_free_space(rrset, udb, sizeof(struct rrset_d));
}
/** clear a domain of its rrsets, rrs */
static void
domain_clear(udb_base* udb, udb_ptr* d)
{
udb_ptr rrset, n;
assert(udb_ptr_get_type(d) == udb_chunk_type_domain);
udb_ptr_new(&rrset, udb, &DOMAIN(d)->rrsets);
udb_ptr_init(&n, udb);
udb_rptr_zero(&DOMAIN(d)->rrsets, udb);
while(!udb_ptr_is_null(&rrset)) {
udb_ptr_set_rptr(&n, udb, &RRSET(&rrset)->next);
rrset_delete(udb, &rrset);
udb_ptr_set_ptr(&rrset, udb, &n);
udb_ptr_zero(&n, udb);
}
udb_ptr_unlink(&n, udb);
udb_ptr_unlink(&rrset, udb);
}
/** delete a domain and all its rrsets, rrs */
static void
domain_delete(udb_base* udb, udb_ptr* d)
{
domain_clear(udb, d);
udb_rptr_zero(&DOMAIN(d)->node, udb);
udb_ptr_free_space(d, udb,
sizeof(struct domain_d)+DOMAIN(d)->namelen);
}
/** delete domain but also unlink from tree at zone */
static void
domain_delete_unlink(udb_base* udb, udb_ptr* z, udb_ptr* d)
{
udb_ptr dtree, n;
udb_ptr_new(&dtree, udb, &ZONE(z)->domains);
udb_ptr_new(&n, udb, &DOMAIN(d)->node);
udb_rptr_zero(&DOMAIN(d)->node, udb);
udb_radix_delete(udb, &dtree, &n);
udb_ptr_unlink(&dtree, udb);
udb_ptr_unlink(&n, udb);
domain_delete(udb, d);
}
void
udb_zone_clear(udb_base* udb, udb_ptr* zone)
{
udb_ptr dtree, d;
assert(udb_ptr_get_type(zone) == udb_chunk_type_zone);
udb_ptr_new(&dtree, udb, &ZONE(zone)->domains);
udb_rptr_zero(&ZONE(zone)->nsec3param, udb);
udb_zone_set_log_str(udb, zone, NULL);
udb_zone_set_file_str(udb, zone, NULL);
/* walk and delete all domains, rrsets, rrs, but keep tree */
for(udb_radix_first(udb, &dtree, &d); d.data; udb_radix_next(udb, &d)){
udb_ptr domain;
udb_ptr_new(&domain, udb, &RADNODE(&d)->elem);
udb_rptr_zero(&RADNODE(&d)->elem, udb);
domain_delete(udb, &domain);
}
udb_ptr_unlink(&d, udb);
udb_radix_tree_clear(udb, &dtree);
ZONE(zone)->rrset_count = 0;
ZONE(zone)->rr_count = 0;
ZONE(zone)->expired = 0;
ZONE(zone)->mtime = 0;
ZONE(zone)->mtime_nsec = 0;
udb_ptr_unlink(&dtree, udb);
}
void
udb_zone_delete(udb_base* udb, udb_ptr* zone)
{
udb_ptr ztree, n;
udb_ptr_new(&ztree, udb, udb_base_get_userdata(udb));
udb_ptr_new(&n, udb, &ZONE(zone)->node);
udb_rptr_zero(&ZONE(zone)->node, udb);
udb_radix_delete(udb, &ztree, &n);
udb_ptr_unlink(&ztree, udb);
udb_ptr_unlink(&n, udb);
udb_zone_delete_plain(udb, zone);
}
int
udb_zone_search(udb_base* udb, udb_ptr* result, const uint8_t* dname,
size_t dname_len)
{
udb_ptr ztree;
udb_ptr_new(&ztree, udb, udb_base_get_userdata(udb));
assert(udb_ptr_get_type(&ztree) == udb_chunk_type_radtree);
if(udb_radname_search(udb, &ztree, dname, dname_len, result)) {
if(result->data)
udb_ptr_set_rptr(result, udb, &RADNODE(result)->elem);
udb_ptr_unlink(&ztree, udb);
return (result->data != 0);
}
udb_ptr_unlink(&ztree, udb);
return 0;
}
void udb_zone_get_mtime(udb_base* udb, const uint8_t* dname, size_t dlen,
struct timespec* mtime)
{
udb_ptr z;
if(udb_zone_search(udb, &z, dname, dlen)) {
mtime->tv_sec = ZONE(&z)->mtime;
mtime->tv_nsec = ZONE(&z)->mtime_nsec;
udb_ptr_unlink(&z, udb);
return;
}
mtime->tv_sec = 0;
mtime->tv_nsec = 0;
}
void udb_zone_set_log_str(udb_base* udb, udb_ptr* zone, const char* str)
{
/* delete original log str (if any) */
if(ZONE(zone)->log_str.data) {
udb_ptr s;
size_t sz;
udb_ptr_new(&s, udb, &ZONE(zone)->log_str);
udb_rptr_zero(&ZONE(zone)->log_str, udb);
sz = strlen((char*)udb_ptr_data(&s))+1;
udb_ptr_free_space(&s, udb, sz);
}
/* set new log str */
if(str) {
udb_ptr s;
size_t sz = strlen(str)+1;
if(!udb_ptr_alloc_space(&s, udb, udb_chunk_type_data, sz)) {
return; /* failed to allocate log string */
}
memmove(udb_ptr_data(&s), str, sz);
udb_rptr_set_ptr(&ZONE(zone)->log_str, udb, &s);
udb_ptr_unlink(&s, udb);
}
}
void udb_zone_set_file_str(udb_base* udb, udb_ptr* zone, const char* str)
{
/* delete original file str (if any) */
if(ZONE(zone)->file_str.data) {
udb_ptr s;
size_t sz;
udb_ptr_new(&s, udb, &ZONE(zone)->file_str);
udb_rptr_zero(&ZONE(zone)->file_str, udb);
sz = strlen((char*)udb_ptr_data(&s))+1;
udb_ptr_free_space(&s, udb, sz);
}
/* set new file str */
if(str) {
udb_ptr s;
size_t sz = strlen(str)+1;
if(!udb_ptr_alloc_space(&s, udb, udb_chunk_type_data, sz)) {
return; /* failed to allocate file string */
}
memmove(udb_ptr_data(&s), str, sz);
udb_rptr_set_ptr(&ZONE(zone)->file_str, udb, &s);
udb_ptr_unlink(&s, udb);
}
}
const char* udb_zone_get_file_str(udb_base* udb, const uint8_t* dname,
size_t dlen)
{
udb_ptr z;
if(udb_zone_search(udb, &z, dname, dlen)) {
const char* str;
if(ZONE(&z)->file_str.data) {
udb_ptr s;
udb_ptr_new(&s, udb, &ZONE(&z)->file_str);
str = (const char*)udb_ptr_data(&s);
udb_ptr_unlink(&s, udb);
} else str = NULL;
udb_ptr_unlink(&z, udb);
return str;
}
return NULL;
}
#ifdef NSEC3
/** select the nsec3param for nsec3 usage */
static void
select_nsec3_param(udb_base* udb, udb_ptr* zone, udb_ptr* rrset)
{
udb_ptr rr;
udb_ptr_new(&rr, udb, &RRSET(rrset)->rrs);
while(rr.data) {
if(RR(&rr)->len >= 5 && RR(&rr)->wire[0] == NSEC3_SHA1_HASH &&
RR(&rr)->wire[1] == 0) {
udb_rptr_set_ptr(&ZONE(zone)->nsec3param, udb, &rr);
udb_ptr_unlink(&rr, udb);
return;
}
udb_ptr_set_rptr(&rr, udb, &RR(&rr)->next);
}
udb_ptr_unlink(&rr, udb);
}
const char*
udb_nsec3param_string(udb_ptr* rr)
{
/* max saltlenth plus first couple of numbers (3+1+5+1+3+1) */
static char params[MAX_RDLENGTH*2+16];
char* p;
assert(RR(rr)->len >= 5);
p = params + snprintf(params, sizeof(params), "%u %u %u ",
(unsigned)RR(rr)->wire[0], (unsigned)RR(rr)->wire[1],
(unsigned)read_uint16(&RR(rr)->wire[2]));
if(RR(rr)->wire[4] == 0) {
*p++ = '-';
} else {
assert(RR(rr)->len >= 5+RR(rr)->wire[4]);
p += hex_ntop(&RR(rr)->wire[5], RR(rr)->wire[4], p,
sizeof(params)-strlen(params)-1);
}
*p = 0;
return params;
}
/** look in zone for new selected nsec3param record from rrset */
static void
zone_hash_nsec3param(udb_base* udb, udb_ptr* zone, udb_ptr* rrset)
{
select_nsec3_param(udb, zone, rrset);
if(ZONE(zone)->nsec3param.data == 0)
return;
/* prettyprint the nsec3 parameters we are using */
if(2 <= verbosity) {
udb_ptr par;
udb_ptr_new(&par, udb, &ZONE(zone)->nsec3param);
VERBOSITY(1, (LOG_INFO, "rehash of zone %s with parameters %s",
wiredname2str(ZONE(zone)->name),
udb_nsec3param_string(&par)));
udb_ptr_unlink(&par, udb);
}
}
#endif /* NSEC3 */
/** create a new domain name */
static int
domain_create(udb_base* udb, udb_ptr* zone, const uint8_t* nm, size_t nmlen,
udb_ptr* result)
{
udb_ptr dtree, node;
/* create domain chunk */
if(!udb_ptr_alloc_space(result, udb, udb_chunk_type_domain,
sizeof(struct domain_d)+nmlen))
return 0;
udb_rel_ptr_init(&DOMAIN(result)->node);
udb_rel_ptr_init(&DOMAIN(result)->rrsets);
DOMAIN(result)->namelen = nmlen;
memmove(DOMAIN(result)->name, nm, nmlen);
/* insert into domain tree */
udb_ptr_new(&dtree, udb, &ZONE(zone)->domains);
if(!udb_radname_insert(udb, &dtree, nm, nmlen, result, &node)) {
udb_ptr_free_space(result, udb, sizeof(struct domain_d)+nmlen);
udb_ptr_unlink(&dtree, udb);
return 0;
}
udb_rptr_set_ptr(&DOMAIN(result)->node, udb, &node);
udb_ptr_unlink(&dtree, udb);
udb_ptr_unlink(&node, udb);
return 1;
}
int
udb_domain_find(udb_base* udb, udb_ptr* zone, const uint8_t* nm, size_t nmlen,
udb_ptr* result)
{
int r;
udb_ptr dtree;
assert(udb_ptr_get_type(zone) == udb_chunk_type_zone);
udb_ptr_new(&dtree, udb, &ZONE(zone)->domains);
r = udb_radname_search(udb, &dtree, nm, nmlen, result);
if(result->data)
udb_ptr_set_rptr(result, udb, &RADNODE(result)->elem);
udb_ptr_unlink(&dtree, udb);
return r && result->data;
}
/** find or create a domain name in the zone domain tree */
static int
domain_find_or_create(udb_base* udb, udb_ptr* zone, const uint8_t* nm,
size_t nmlen, udb_ptr* result)
{
assert(udb_ptr_get_type(zone) == udb_chunk_type_zone);
if(udb_domain_find(udb, zone, nm, nmlen, result))
return 1;
return domain_create(udb, zone, nm, nmlen, result);
}
/** remove rrset from the domain name rrset-list */
static void
domain_remove_rrset(udb_base* udb, udb_ptr* domain, uint16_t t)
{
udb_ptr p, prev;
assert(udb_ptr_get_type(domain) == udb_chunk_type_domain);
udb_ptr_new(&p, udb, &DOMAIN(domain)->rrsets);
udb_ptr_init(&prev, udb);
while(p.data) {
if(RRSET(&p)->type == t) {
/* remove it */
if(prev.data == 0) {
/* first rrset */
udb_rptr_set_rptr(&DOMAIN(domain)->rrsets,
udb, &RRSET(&p)->next);
} else {
udb_rptr_set_rptr(&RRSET(&prev)->next,
udb, &RRSET(&p)->next);
}
udb_ptr_unlink(&prev, udb);
rrset_delete(udb, &p);
return;
}
udb_ptr_set_ptr(&prev, udb, &p);
udb_ptr_set_rptr(&p, udb, &RRSET(&p)->next);
}
/* rrset does not exist */
udb_ptr_unlink(&prev, udb);
udb_ptr_unlink(&p, udb);
}
/** create rrset in the domain rrset list */
static int
rrset_create(udb_base* udb, udb_ptr* domain, uint16_t t, udb_ptr* res)
{
/* create it */
if(!udb_ptr_alloc_space(res, udb, udb_chunk_type_rrset,
sizeof(struct rrset_d)))
return 0;
udb_rel_ptr_init(&RRSET(res)->next);
udb_rel_ptr_init(&RRSET(res)->rrs);
RRSET(res)->type = t;
#if 0
/* link it in, at the front */
udb_rptr_set_rptr(&RRSET(res)->next, udb, &DOMAIN(domain)->rrsets);
udb_rptr_set_ptr(&DOMAIN(domain)->rrsets, udb, res);
#else
/* preserve RRset order, link at end */
if(DOMAIN(domain)->rrsets.data == 0) {
udb_rptr_set_ptr(&DOMAIN(domain)->rrsets, udb, res);
} else {
udb_ptr p;
udb_ptr_new(&p, udb, &DOMAIN(domain)->rrsets);
while(RRSET(&p)->next.data)
udb_ptr_set_rptr(&p, udb, &RRSET(&p)->next);
udb_rptr_set_ptr(&RRSET(&p)->next, udb, res);
udb_ptr_unlink(&p, udb);
}
#endif
return 1;
}
int
udb_rrset_find(udb_base* udb, udb_ptr* domain, uint16_t t, udb_ptr* res)
{
assert(udb_ptr_get_type(domain) == udb_chunk_type_domain);
udb_ptr_init(res, udb);
udb_ptr_set_rptr(res, udb, &DOMAIN(domain)->rrsets);
while(res->data) {
if(RRSET(res)->type == t)
return 1;
udb_ptr_set_rptr(res, udb, &RRSET(res)->next);
}
/* rrset does not exist and res->data is conveniently zero */
return 0;
}
/** find or create rrset in the domain rrset list */
static int
rrset_find_or_create(udb_base* udb, udb_ptr* domain, uint16_t t, udb_ptr* res)
{
if(udb_rrset_find(udb, domain, t, res))
return 1;
return rrset_create(udb, domain, t, res);
}
/** see if RR matches type, class and rdata */
static int
rr_match(udb_ptr* rr, uint16_t t, uint16_t k, uint8_t* rdata, size_t rdatalen)
{
return RR(rr)->type == t && RR(rr)->klass == k &&
RR(rr)->len == rdatalen &&
memcmp(RR(rr)->wire, rdata, rdatalen) == 0;
}
/** see if RR exists in the RR list that matches the rdata, and return it */
static int
rr_search(udb_base* udb, udb_ptr* rrset, uint16_t t, uint16_t k,
uint8_t* rdata, size_t rdatalen, udb_ptr* result)
{
assert(udb_ptr_get_type(rrset) == udb_chunk_type_rrset);
udb_ptr_init(result, udb);
udb_ptr_set_rptr(result, udb, &RRSET(rrset)->rrs);
while(result->data) {
if(rr_match(result, t, k, rdata, rdatalen))
return 1; /* found */
udb_ptr_set_rptr(result, udb, &RR(result)->next);
}
/* not found and result->data is conveniently zero */
return 0;
}
/** create RR chunk */
static int
rr_create(udb_base* udb, uint16_t t, uint16_t k, uint32_t ttl,
uint8_t* rdata, size_t rdatalen, udb_ptr* rr)
{
if(!udb_ptr_alloc_space(rr, udb, udb_chunk_type_rr,
sizeof(struct rr_d)+rdatalen))
return 0;
udb_rel_ptr_init(&RR(rr)->next);
RR(rr)->type = t;
RR(rr)->klass = k;
RR(rr)->ttl = ttl;
RR(rr)->len = rdatalen;
memmove(RR(rr)->wire, rdata, rdatalen);
return 1;
}
/** add an RR to an RRset. */
static int
rrset_add_rr(udb_base* udb, udb_ptr* rrset, uint16_t t, uint16_t k,
uint32_t ttl, uint8_t* rdata, size_t rdatalen)
{
udb_ptr rr;
assert(udb_ptr_get_type(rrset) == udb_chunk_type_rrset);
/* create it */
if(!rr_create(udb, t, k, ttl, rdata, rdatalen, &rr))
return 0;
/* add at end, to preserve order of RRs */
if(RRSET(rrset)->rrs.data == 0) {
udb_rptr_set_ptr(&RRSET(rrset)->rrs, udb, &rr);
} else {
udb_ptr lastrr;
udb_ptr_new(&lastrr, udb, &RRSET(rrset)->rrs);
while(RR(&lastrr)->next.data)
udb_ptr_set_rptr(&lastrr, udb, &RR(&lastrr)->next);
udb_rptr_set_ptr(&RR(&lastrr)->next, udb, &rr);
udb_ptr_unlink(&lastrr, udb);
}
udb_ptr_unlink(&rr, udb);
return 1;
}
/** remove an RR from an RRset. return 0 if RR did not exist. */
static int
rrset_del_rr(udb_base* udb, udb_ptr* rrset, uint16_t t, uint16_t k,
uint8_t* rdata, size_t rdatalen)
{
udb_ptr p, prev;
assert(udb_ptr_get_type(rrset) == udb_chunk_type_rrset);
udb_ptr_new(&p, udb, &RRSET(rrset)->rrs);
udb_ptr_init(&prev, udb);
while(p.data) {
if(rr_match(&p, t, k, rdata, rdatalen)) {
/* remove it */
if(prev.data == 0) {
/* first in list */
udb_rptr_set_rptr(&RRSET(rrset)->rrs, udb,
&RR(&p)->next);
} else {
udb_rptr_set_rptr(&RR(&prev)->next, udb,
&RR(&p)->next);
}
udb_ptr_unlink(&prev, udb);
rr_delete(udb, &p);
return 1;
}
udb_ptr_set_ptr(&prev, udb, &p);
udb_ptr_set_rptr(&p, udb, &RR(&p)->next);
}
/* not found */
udb_ptr_unlink(&prev, udb);
udb_ptr_unlink(&p, udb);
return 0;
}
int
udb_zone_add_rr(udb_base* udb, udb_ptr* zone, const uint8_t* nm, size_t nmlen,
uint16_t t, uint16_t k, uint32_t ttl, uint8_t* rdata, size_t rdatalen)
{
udb_ptr domain, rrset, rr;
int created_rrset = 0;
assert(udb_ptr_get_type(zone) == udb_chunk_type_zone);
/* find or create domain */
if(!domain_find_or_create(udb, zone, nm, nmlen, &domain)) {
return 0;
}
/* find or create rrset(type) */
if(!rrset_find_or_create(udb, &domain, t, &rrset)) {
goto exit_clean_domain;
}
if(RRSET(&rrset)->rrs.data == 0)
created_rrset = 1;
/* test for duplicate RRs */
if(rr_search(udb, &rrset, t, k, rdata, rdatalen, &rr)) {
udb_ptr_unlink(&rr, udb);
goto exit_clean_domain_rrset;
}
/* add RR to rrset */
if(!rrset_add_rr(udb, &rrset, t, k, ttl, rdata, rdatalen)) {
exit_clean_domain_rrset:
/* if rrset was created, remove it */
if(RRSET(&rrset)->rrs.data == 0) {
udb_ptr_zero(&rrset, udb);
domain_remove_rrset(udb, &domain, t);
}
udb_ptr_unlink(&rrset, udb);
exit_clean_domain:
/* if domain created, delete it */
if(DOMAIN(&domain)->rrsets.data == 0)
domain_delete_unlink(udb, zone, &domain);
udb_ptr_unlink(&domain, udb);
return 0;
}
/* success, account changes */
if(created_rrset)
ZONE(zone)->rrset_count ++;
ZONE(zone)->rr_count ++;
#ifdef NSEC3
if(t == TYPE_NSEC3PARAM && ZONE(zone)->nsec3param.data == 0)
zone_hash_nsec3param(udb, zone, &rrset);
#endif /* NSEC3 */
udb_ptr_unlink(&domain, udb);
udb_ptr_unlink(&rrset, udb);
return 1;
}
void
udb_zone_del_rr(udb_base* udb, udb_ptr* zone, const uint8_t* nm, size_t nmlen,
uint16_t t, uint16_t k, uint8_t* rdata, size_t rdatalen)
{
udb_ptr domain, rrset;
assert(udb_ptr_get_type(zone) == udb_chunk_type_zone);
/* find the domain */
if(!udb_domain_find(udb, zone, nm, nmlen, &domain))
return;
/* find the rrset */
if(!udb_rrset_find(udb, &domain, t, &rrset)) {
udb_ptr_unlink(&domain, udb);
return;
}
/* remove the RR */
#ifdef NSEC3
if(t == TYPE_NSEC3PARAM) {
udb_ptr rr;
if(rr_search(udb, &rrset, t, k, rdata, rdatalen, &rr)) {
if(rr.data == ZONE(zone)->nsec3param.data) {
udb_rptr_zero(&ZONE(zone)->nsec3param, udb);
}
udb_ptr_unlink(&rr, udb);
}
}
#endif /* NSEC3 */
if(!rrset_del_rr(udb, &rrset, t, k, rdata, rdatalen)) {
/* rr did not exist */
udb_ptr_unlink(&domain, udb);
udb_ptr_unlink(&rrset, udb);
return;
}
ZONE(zone)->rr_count --;
#ifdef NSEC3
if(t == TYPE_NSEC3PARAM && ZONE(zone)->nsec3param.data == 0 &&
RRSET(&rrset)->rrs.data != 0) {
zone_hash_nsec3param(udb, zone, &rrset);
}
#endif /* NSEC3 */
/* see we we can remove the rrset too */
if(RRSET(&rrset)->rrs.data == 0) {
udb_ptr_zero(&rrset, udb);
domain_remove_rrset(udb, &domain, t);
ZONE(zone)->rrset_count --;
}
/* see if we can remove the domain name too */
if(DOMAIN(&domain)->rrsets.data == 0) {
domain_delete_unlink(udb, zone, &domain);
}
udb_ptr_unlink(&rrset, udb);
udb_ptr_unlink(&domain, udb);
}
void
udb_zone_walk_chunk(void* base, void* d, uint64_t s, udb_walk_relptr_cb* cb,
void* arg)
{
struct zone_d* p = (struct zone_d*)d;
assert(s >= sizeof(struct zone_d)+p->namelen);
(void)s;
(*cb)(base, &p->node, arg);
(*cb)(base, &p->domains, arg);
(*cb)(base, &p->nsec3param, arg);
(*cb)(base, &p->log_str, arg);
(*cb)(base, &p->file_str, arg);
}
void
udb_domain_walk_chunk(void* base, void* d, uint64_t s, udb_walk_relptr_cb* cb,
void* arg)
{
struct domain_d* p = (struct domain_d*)d;
assert(s >= sizeof(struct domain_d)+p->namelen);
(void)s;
(*cb)(base, &p->node, arg);
(*cb)(base, &p->rrsets, arg);
}
void
udb_rrset_walk_chunk(void* base, void* d, uint64_t s, udb_walk_relptr_cb* cb,
void* arg)
{
struct rrset_d* p = (struct rrset_d*)d;
assert(s >= sizeof(struct rrset_d));
(void)s;
(*cb)(base, &p->next, arg);
(*cb)(base, &p->rrs, arg);
}
void
udb_rr_walk_chunk(void* base, void* d, uint64_t s, udb_walk_relptr_cb* cb,
void* arg)
{
struct rr_d* p = (struct rr_d*)d;
assert(s >= sizeof(struct rr_d)+p->len);
(void)s;
(*cb)(base, &p->next, arg);
}
void
udb_task_walk_chunk(void* base, void* d, uint64_t s, udb_walk_relptr_cb* cb,
void* arg)
{
struct task_list_d* p = (struct task_list_d*)d;
assert(s >= p->size);
(void)s;
(*cb)(base, &p->next, arg);
}
void namedb_walkfunc(void* base, void* warg, uint8_t t, void* d, uint64_t s,
udb_walk_relptr_cb* cb, void* arg)
{
(void)warg;
switch(t) {
case udb_chunk_type_radtree:
udb_radix_tree_walk_chunk(base, d, s, cb, arg);
break;
case udb_chunk_type_radnode:
udb_radix_node_walk_chunk(base, d, s, cb, arg);
break;
case udb_chunk_type_radarray:
udb_radix_array_walk_chunk(base, d, s, cb, arg);
break;
case udb_chunk_type_zone:
udb_zone_walk_chunk(base, d, s, cb, arg);
break;
case udb_chunk_type_domain:
udb_domain_walk_chunk(base, d, s, cb, arg);
break;
case udb_chunk_type_rrset:
udb_rrset_walk_chunk(base, d, s, cb, arg);
break;
case udb_chunk_type_rr:
udb_rr_walk_chunk(base, d, s, cb, arg);
break;
case udb_chunk_type_task:
udb_task_walk_chunk(base, d, s, cb, arg);
break;
default:
/* no rel ptrs */
break;
}
}

View File

@ -1,160 +0,0 @@
/*
* udbzone -- store zone and rrset information in udb file.
*
* Copyright (c) 2011, NLnet Labs. See LICENSE for license.
*/
#ifndef UDB_ZONE_H
#define UDB_ZONE_H
#include "udb.h"
#include "dns.h"
#include "udbradtree.h"
/**
* Store the DNS information in udb file on disk.
* udb_global
* |
* v
* zonetree -> zone -- zone_name
* radtree |--> nsec3param
* |--> log_str
* |--> file_str
* |
* v
* domain --> rrset -> rr
* radtree list list
* |-- name
*/
/** zone information in the nsd.udb. Name allocated after it. */
struct zone_d {
/** radtree node in the zonetree for this zone */
udb_rel_ptr node;
/** the radtree for the domain names in the zone */
udb_rel_ptr domains;
/** the NSEC3PARAM rr used for hashing (or 0), rr_d pointer */
udb_rel_ptr nsec3param;
/** the log_str for the AXFR change, or 0 */
udb_rel_ptr log_str;
/** the file name when read from a file, or 0 */
udb_rel_ptr file_str;
/** modification time, time when the zone data was changed */
uint64_t mtime;
/** modification time, nsecs */
uint64_t mtime_nsec;
/** number of RRsets in the zone */
uint64_t rrset_count;
/** number of RRs in the zone */
uint64_t rr_count;
/** the length of the zone name */
udb_radstrlen_type namelen;
/** if the zone is expired */
uint8_t expired;
/** if the zone has been changed by AXFR */
uint8_t is_changed;
/** the zone (wire uncompressed) name in DNS format */
uint8_t name[0];
};
/** domain name in the nametree. name allocated after it */
struct domain_d {
/** radtree node in the nametree for this domain */
udb_rel_ptr node;
/** the list of rrsets for this name, single linked */
udb_rel_ptr rrsets;
/** length of the domain name */
udb_radstrlen_type namelen;
/** the domain (wire uncompressed) name in DNS format */
uint8_t name[0];
};
/** rrset information. */
struct rrset_d {
/** next in rrset list */
udb_rel_ptr next;
/** the singly linked list of rrs for this rrset */
udb_rel_ptr rrs;
/** type of the RRs in this rrset (host order) */
uint16_t type;
};
/** rr information; wireformat data allocated after it */
struct rr_d {
/** next in rr list */
udb_rel_ptr next;
/** type (host order) */
uint16_t type;
/** class (host order) */
uint16_t klass;
/** ttl (host order) */
uint32_t ttl;
/** length of wireformat */
uint16_t len;
/** wireformat of rdata (without rdatalen) */
uint8_t wire[0];
};
/** init an udb for use as DNS store */
int udb_dns_init_file(udb_base* udb);
/** de-init an udb for use as DNS store */
void udb_dns_deinit_file(udb_base* udb);
/** create a zone */
int udb_zone_create(udb_base* udb, udb_ptr* result, const uint8_t* dname,
size_t dlen);
/** clear all RRsets from a zone */
void udb_zone_clear(udb_base* udb, udb_ptr* zone);
/** delete a zone */
void udb_zone_delete(udb_base* udb, udb_ptr* zone);
/** find a zone by name (exact match) */
int udb_zone_search(udb_base* udb, udb_ptr* result, const uint8_t* dname,
size_t dlen);
/** get modification time for zone or 0 */
void udb_zone_get_mtime(udb_base* udb, const uint8_t* dname, size_t dlen,
struct timespec* mtime);
/** set log str in udb, or remove it */
void udb_zone_set_log_str(udb_base* udb, udb_ptr* zone, const char* str);
/** set file str in udb, or remove it */
void udb_zone_set_file_str(udb_base* udb, udb_ptr* zone, const char* str);
/** get file string for zone or NULL */
const char* udb_zone_get_file_str(udb_base* udb, const uint8_t* dname,
size_t dlen);
/** find a domain name in the zone domain tree */
int udb_domain_find(udb_base* udb, udb_ptr* zone, const uint8_t* nm,
size_t nmlen, udb_ptr* result);
/** find rrset in domain */
int udb_rrset_find(udb_base* udb, udb_ptr* domain, uint16_t t, udb_ptr* res);
/** add an RR to a zone */
int udb_zone_add_rr(udb_base* udb, udb_ptr* zone, const uint8_t* nm,
size_t nmlen, uint16_t t, uint16_t k, uint32_t ttl, uint8_t* rdata,
size_t rdatalen);
/** del an RR from a zone */
void udb_zone_del_rr(udb_base* udb, udb_ptr* zone, const uint8_t* nm,
size_t nmlen, uint16_t t, uint16_t k, uint8_t* rdata, size_t rdatalen);
/** get pretty string for nsec3parameters (static buffer returned) */
const char* udb_nsec3param_string(udb_ptr* rr);
/** for use in udb-walkfunc, walks relptrs in udb_chunk_type_zone */
void udb_zone_walk_chunk(void* base, void* d, uint64_t s,
udb_walk_relptr_cb* cb, void* arg);
/** for use in udb-walkfunc, walks relptrs in udb_chunk_type_domain */
void udb_domain_walk_chunk(void* base, void* d, uint64_t s,
udb_walk_relptr_cb* cb, void* arg);
/** for use in udb-walkfunc, walks relptrs in udb_chunk_type_rrset */
void udb_rrset_walk_chunk(void* base, void* d, uint64_t s,
udb_walk_relptr_cb* cb, void* arg);
/** for use in udb-walkfunc, walks relptrs in udb_chunk_type_rr */
void udb_rr_walk_chunk(void* base, void* d, uint64_t s,
udb_walk_relptr_cb* cb, void* arg);
/** walk through relptrs in registered types */
void namedb_walkfunc(void* base, void* warg, uint8_t t, void* d, uint64_t s,
udb_walk_relptr_cb* cb, void* arg);
#define ZONE(ptr) ((struct zone_d*)UDB_PTR(ptr))
#define DOMAIN(ptr) ((struct domain_d*)UDB_PTR(ptr))
#define RRSET(ptr) ((struct rrset_d*)UDB_PTR(ptr))
#define RR(ptr) ((struct rr_d*)UDB_PTR(ptr))
#endif /* UDB_ZONE_H */

View File

@ -7,8 +7,8 @@
*
*/
#ifndef _UTIL_H_
#define _UTIL_H_
#ifndef UTIL_H
#define UTIL_H
#include <sys/time.h>
#include <stdarg.h>
@ -451,4 +451,4 @@ void activate_cookie_secret(struct nsd* nsd);
/* Drop a cookie secret. Drops the staging secret. An active secret will not
* be dropped. */
void drop_cookie_secret(struct nsd* nsd);
#endif /* _UTIL_H_ */
#endif /* UTIL_H */

View File

@ -627,6 +627,12 @@ parser_flush(void)
lexer_state = EXPECT_OWNER;
}
int at_eof(void)
{
static int once = 1;
return (once = !once) ? 0 : NL;
}
#ifndef yy_set_bol /* compat definition, for flex 2.4.6 */
#define yy_set_bol(at_bol) \
{ \
@ -636,18 +642,18 @@ parser_flush(void)
}
#endif
#line 638 "<stdout>"
#line 644 "<stdout>"
#define YY_NO_INPUT 1
#line 121 "zlexer.lex"
#line 127 "zlexer.lex"
#ifndef YY_NO_UNPUT
#define YY_NO_UNPUT 1
#endif
#ifndef YY_NO_INPUT
#define YY_NO_INPUT 1
#endif
#line 647 "<stdout>"
#line 653 "<stdout>"
#line 649 "<stdout>"
#line 655 "<stdout>"
#define INITIAL 0
#define incl 1
@ -868,9 +874,9 @@ YY_DECL
}
{
#line 143 "zlexer.lex"
#line 149 "zlexer.lex"
#line 872 "<stdout>"
#line 878 "<stdout>"
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
{
@ -936,17 +942,17 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
YY_RULE_SETUP
#line 144 "zlexer.lex"
#line 150 "zlexer.lex"
/* ignore */
YY_BREAK
case 2:
YY_RULE_SETUP
#line 145 "zlexer.lex"
#line 151 "zlexer.lex"
{ lexer_state = PARSING_RDATA; return DOLLAR_TTL; }
YY_BREAK
case 3:
YY_RULE_SETUP
#line 146 "zlexer.lex"
#line 152 "zlexer.lex"
{ lexer_state = PARSING_RDATA; return DOLLAR_ORIGIN; }
YY_BREAK
/*
@ -955,7 +961,7 @@ YY_RULE_SETUP
*/
case 4:
YY_RULE_SETUP
#line 152 "zlexer.lex"
#line 158 "zlexer.lex"
{
BEGIN(incl);
/* ignore case statement fallthrough on incl<EOF> flex rule */
@ -963,10 +969,10 @@ YY_RULE_SETUP
YY_BREAK
case 5:
/* rule 5 can match eol */
#line 157 "zlexer.lex"
#line 163 "zlexer.lex"
YY_RULE_SETUP
case YY_STATE_EOF(incl):
#line 157 "zlexer.lex"
#line 163 "zlexer.lex"
{
int error_occurred = parser->error_occurred;
BEGIN(INITIAL);
@ -978,7 +984,7 @@ case YY_STATE_EOF(incl):
YY_BREAK
case 6:
YY_RULE_SETUP
#line 165 "zlexer.lex"
#line 171 "zlexer.lex"
{
char *tmp;
domain_type *origin = parser->origin;
@ -1042,25 +1048,30 @@ YY_RULE_SETUP
}
YY_BREAK
case YY_STATE_EOF(INITIAL):
#line 226 "zlexer.lex"
#line 232 "zlexer.lex"
{
int eo = at_eof();
yy_set_bol(1); /* Set beginning of line, so "^" rules match. */
if (include_stack_ptr == 0) {
if(eo == NL)
return eo;
yyterminate();
} else {
fclose(yyin);
pop_parser_state();
if(eo == NL)
return eo;
}
}
YY_BREAK
case 7:
YY_RULE_SETUP
#line 235 "zlexer.lex"
#line 246 "zlexer.lex"
{ zc_warning("Unknown directive: %s", yytext); }
YY_BREAK
case 8:
YY_RULE_SETUP
#line 236 "zlexer.lex"
#line 247 "zlexer.lex"
{
LEXOUT((". "));
return parse_token('.', yytext, &lexer_state);
@ -1068,7 +1079,7 @@ YY_RULE_SETUP
YY_BREAK
case 9:
YY_RULE_SETUP
#line 240 "zlexer.lex"
#line 251 "zlexer.lex"
{
LEXOUT(("@ "));
return parse_token('@', yytext, &lexer_state);
@ -1076,7 +1087,7 @@ YY_RULE_SETUP
YY_BREAK
case 10:
YY_RULE_SETUP
#line 244 "zlexer.lex"
#line 255 "zlexer.lex"
{
LEXOUT(("\\# "));
return parse_token(URR, yytext, &lexer_state);
@ -1085,7 +1096,7 @@ YY_RULE_SETUP
case 11:
/* rule 11 can match eol */
YY_RULE_SETUP
#line 248 "zlexer.lex"
#line 259 "zlexer.lex"
{
++parser->line;
if (!paren_open) {
@ -1100,7 +1111,7 @@ YY_RULE_SETUP
YY_BREAK
case 12:
YY_RULE_SETUP
#line 259 "zlexer.lex"
#line 270 "zlexer.lex"
{
if (paren_open) {
zc_error("nested parentheses");
@ -1113,7 +1124,7 @@ YY_RULE_SETUP
YY_BREAK
case 13:
YY_RULE_SETUP
#line 268 "zlexer.lex"
#line 279 "zlexer.lex"
{
if (!paren_open) {
zc_error("closing parentheses without opening parentheses");
@ -1126,7 +1137,7 @@ YY_RULE_SETUP
YY_BREAK
case 14:
YY_RULE_SETUP
#line 277 "zlexer.lex"
#line 288 "zlexer.lex"
{
if (!paren_open && lexer_state == EXPECT_OWNER) {
lexer_state = PARSING_TTL_CLASS_TYPE;
@ -1143,11 +1154,11 @@ YY_RULE_SETUP
/* Bitlabels. Strip leading and ending brackets. */
case 15:
YY_RULE_SETUP
#line 291 "zlexer.lex"
#line 302 "zlexer.lex"
{ BEGIN(bitlabel); }
YY_BREAK
case YY_STATE_EOF(bitlabel):
#line 292 "zlexer.lex"
#line 303 "zlexer.lex"
{
zc_error("EOF inside bitlabel");
BEGIN(INITIAL);
@ -1157,18 +1168,18 @@ case YY_STATE_EOF(bitlabel):
YY_BREAK
case 16:
YY_RULE_SETUP
#line 298 "zlexer.lex"
#line 309 "zlexer.lex"
{ yymore(); }
YY_BREAK
case 17:
/* rule 17 can match eol */
YY_RULE_SETUP
#line 299 "zlexer.lex"
#line 310 "zlexer.lex"
{ ++parser->line; yymore(); }
YY_BREAK
case 18:
YY_RULE_SETUP
#line 300 "zlexer.lex"
#line 311 "zlexer.lex"
{
BEGIN(INITIAL);
yytext[yyleng - 1] = '\0';
@ -1178,11 +1189,11 @@ YY_RULE_SETUP
/* Quoted strings. Strip leading and ending quotes. */
case 19:
YY_RULE_SETUP
#line 307 "zlexer.lex"
#line 318 "zlexer.lex"
{ BEGIN(quotedstring); LEXOUT(("\" ")); }
YY_BREAK
case YY_STATE_EOF(quotedstring):
#line 308 "zlexer.lex"
#line 319 "zlexer.lex"
{
zc_error("EOF inside quoted string");
BEGIN(INITIAL);
@ -1192,18 +1203,18 @@ case YY_STATE_EOF(quotedstring):
YY_BREAK
case 20:
YY_RULE_SETUP
#line 314 "zlexer.lex"
#line 325 "zlexer.lex"
{ LEXOUT(("QSTR ")); yymore(); }
YY_BREAK
case 21:
/* rule 21 can match eol */
YY_RULE_SETUP
#line 315 "zlexer.lex"
#line 326 "zlexer.lex"
{ ++parser->line; yymore(); }
YY_BREAK
case 22:
YY_RULE_SETUP
#line 316 "zlexer.lex"
#line 327 "zlexer.lex"
{
LEXOUT(("\" "));
BEGIN(INITIAL);
@ -1214,7 +1225,7 @@ YY_RULE_SETUP
case 23:
/* rule 23 can match eol */
YY_RULE_SETUP
#line 323 "zlexer.lex"
#line 334 "zlexer.lex"
{
/* Any allowed word. */
return parse_token(STR, yytext, &lexer_state);
@ -1222,7 +1233,7 @@ YY_RULE_SETUP
YY_BREAK
case 24:
YY_RULE_SETUP
#line 327 "zlexer.lex"
#line 338 "zlexer.lex"
{
zc_error("unknown character '%c' (\\%03d) seen - is this a zonefile?",
(int) yytext[0], (int) yytext[0]);
@ -1230,10 +1241,10 @@ YY_RULE_SETUP
YY_BREAK
case 25:
YY_RULE_SETUP
#line 331 "zlexer.lex"
#line 342 "zlexer.lex"
ECHO;
YY_BREAK
#line 1235 "<stdout>"
#line 1246 "<stdout>"
case YY_END_OF_BUFFER:
{
@ -2202,7 +2213,7 @@ void yyfree (void * ptr )
#define YYTABLES_NAME "yytables"
#line 331 "zlexer.lex"
#line 342 "zlexer.lex"
/*

View File

@ -33,10 +33,10 @@
#define DBFILE CHROOTDIR "/var/db/nsd/nsd.db"
/* Whether ERR_load_SSL_strings is deprecated */
/* #undef DEPRECATED_ERR_LOAD_SSL_STRINGS */
#define DEPRECATED_ERR_LOAD_SSL_STRINGS 1
/* Whether SHA1_Init is deprecated */
/* #undef DEPRECATED_SHA1_INIT */
#define DEPRECATED_SHA1_INIT 1
/* default dnstap socket path */
/* #undef DNSTAP_SOCKET_PATH */
@ -109,7 +109,7 @@
/* Define to 1 if you have the declaration of `reallocarray', and to 0 if you
don't. */
#define HAVE_DECL_REALLOCARRAY 0
#define HAVE_DECL_REALLOCARRAY 1
/* Define to 1 if you have the declaration of `SSL_CTX_set_ecdh_auto', and to
0 if you don't. */
@ -557,13 +557,13 @@
#define NSEC3 /**/
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "nsd-bugs@nlnetlabs.nl"
#define PACKAGE_BUGREPORT "https://github.com/NLnetLabs/nsd/issues or nsd-bugs@nlnetlabs.nl"
/* Define to the full name of this package. */
#define PACKAGE_NAME "NSD"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "NSD 4.6.0"
#define PACKAGE_STRING "NSD 4.8.0"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "nsd"
@ -844,6 +844,7 @@
#include <sys/types.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#ifdef HAVE_TIME_H
#include <time.h>

View File

@ -1,9 +1,9 @@
# $NetBSD: Makefile,v 1.5 2023/05/12 02:26:48 christos Exp $
# $NetBSD: Makefile,v 1.6 2024/02/17 17:43:20 christos Exp $
LIBISPRIVATE=yes
.include <bsd.init.mk>
.PATH: ${NSD}/compat
.PATH: ${NSD}/compat ${NSD}/util
CPPFLAGS+=-I${NSD} -I${NSD}/../include
@ -27,6 +27,7 @@ nsec3.c \
options.c \
packet.c \
popen3.c \
proxy_protocol.c \
query.c \
radtree.c \
radtree.c \
@ -38,8 +39,6 @@ siphash.c \
tsig-openssl.c \
tsig.c \
udb.c \
udbradtree.c \
udbzone.c \
util.c \
verify.c