zonefiles-write{COLON} { LEXOUT(("v(%s) ", yytext)); return VAR_ZONEFILES_WRITE;}
log-time-ascii{COLON} { LEXOUT(("v(%s) ", yytext)); return VAR_LOG_TIME_ASCII;}
round-robin{COLON} { LEXOUT(("v(%s) ", yytext)); return VAR_ROUND_ROBIN;}
+minimal-responses{COLON} { LEXOUT(("v(%s) ", yytext)); return VAR_MINIMAL_RESPONSES;}
max-refresh-time{COLON} { LEXOUT(("v(%s) ", yytext)); return VAR_MAX_REFRESH_TIME;}
min-refresh-time{COLON} { LEXOUT(("v(%s) ", yytext)); return VAR_MIN_REFRESH_TIME;}
max-retry-time{COLON} { LEXOUT(("v(%s) ", yytext)); return VAR_MAX_RETRY_TIME;}
%token VAR_ROUND_ROBIN VAR_ZONESTATS VAR_REUSEPORT VAR_VERSION
%token VAR_MAX_REFRESH_TIME VAR_MIN_REFRESH_TIME
%token VAR_MAX_RETRY_TIME VAR_MIN_RETRY_TIME
-%token VAR_MULTI_MASTER_CHECK
+%token VAR_MULTI_MASTER_CHECK VAR_MINIMAL_RESPONSES
%%
toplevelvars: /* empty */ | toplevelvars toplevelvar ;
server_rrl_ipv4_prefix_length | server_rrl_ipv6_prefix_length | server_rrl_whitelist_ratelimit |
server_zonefiles_check | server_do_ip4 | server_do_ip6 |
server_zonefiles_write | server_log_time_ascii | server_round_robin |
- server_reuseport | server_version | server_ip_freebind;
+ server_reuseport | server_version | server_ip_freebind |
+ server_minimal_responses;
server_ip_address: VAR_IP_ADDRESS STRING
{
OUTYY(("P(server_ip_address:%s)\n", $2));
}
}
;
+server_minimal_responses: VAR_MINIMAL_RESPONSES STRING
+ {
+ OUTYY(("P(server_minimal_responses:%s)\n", $2));
+ if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
+ yyerror("expected yes or no.");
+ else {
+ cfg_parser->opt->minimal_responses = (strcmp($2, "yes")==0);
+ minimal_responses = cfg_parser->opt->minimal_responses;
+ }
+ }
+ ;
server_server_count: VAR_SERVER_COUNT STRING
{
OUTYY(("P(server_server_count:%s)\n", $2));
sinclude(acx_nlnetlabs.m4)
-AC_INIT(NSD,4.1.15,nsd-bugs@nlnetlabs.nl)
+AC_INIT(NSD,4.1.16,nsd-bugs@nlnetlabs.nl)
AC_CONFIG_HEADER([config.h])
CFLAGS="$CFLAGS"
rr_type *rrs_old;
ssize_t rdata_num;
int rrnum;
+#ifdef NSEC3
int rrset_added = 0;
+#endif
domain = domain_table_find(db->domains, dname);
if(!domain) {
/* create the domain */
rrset->rrs = 0;
rrset->rr_count = 0;
domain_add_rrset(domain, rrset);
+#ifdef NSEC3
rrset_added = 1;
+#endif
}
/* dnames in rdata are normalized, conform RFC 4035,
SERV_GET_BIN(zonefiles_check, o);
SERV_GET_BIN(log_time_ascii, o);
SERV_GET_BIN(round_robin, o);
+ SERV_GET_BIN(minimal_responses, o);
/* str */
SERV_GET_PATH(final, database, o);
SERV_GET_STR(identity, o);
printf("\txfrd-reload-timeout: %d\n", opt->xfrd_reload_timeout);
printf("\tlog-time-ascii: %s\n", opt->log_time_ascii?"yes":"no");
printf("\tround-robin: %s\n", opt->round_robin?"yes":"no");
+ printf("\tminimal-responses: %s\n", opt->minimal_responses?"yes":"no");
printf("\tverbosity: %d\n", opt->verbosity);
for(ip = opt->ip_addresses; ip; ip=ip->next)
{
order of records in the answer and this may balance load across them.
The default is no.
.TP
+.B minimal\-responses:\fR <yes or no>
+Enable minimal responses for smaller answers. This makes packets smaller.
+Extra data is only added for referrals, when it is really necessary.
+This is different from the \-\-enable-minimal-responses configure time option,
+that reduces packets, but exactly to the fragmentation length, the nsd.conf
+option reduces packets as small as possible.
+The default is no.
+.TP
.B zonefiles\-check:\fR <yes or no>
Make NSD check the mtime of zone files on start and sighup. If you
disable it it starts faster (less disk activity in case of a lot of zones).
# round robin rotation of records in the answer.
# round-robin: no
+ # minimal-responses only emits extra data for referrals.
+ # minimal-responses: no
+
# check mtime of all zone files on start and sighup
# zonefiles-check: yes
opt->logfile = 0;
opt->log_time_ascii = 1;
opt->round_robin = 0; /* also packet.h::round_robin */
+ opt->minimal_responses = 0; /* also packet.h::minimal_responses */
opt->server_count = 1;
opt->tcp_count = 100;
opt->tcp_query_count = 0;
int zonefiles_write;
int log_time_ascii;
int round_robin;
+ int minimal_responses;
int reuseport;
/** remote control section. enable toggle. */
#include "rdata.h"
int round_robin = 0;
+int minimal_responses = 0;
static void
encode_dname(query_type *q, domain_type *domain)
/* use round robin rotation */
extern int round_robin;
+/* use minimal responses (more minimal, with additional only for referrals) */
+extern int minimal_responses;
/*
* Encode RR with OWNER as owner name into QUERY. Returns the number
assert(rrset_rrclass(rrset) == CLASS_IN);
result = answer_add_rrset(answer, section, owner, rrset);
+ if(minimal_responses && section != AUTHORITY_SECTION &&
+ query->qtype != TYPE_NS)
+ return result;
switch (rrset_rrtype(rrset)) {
case TYPE_NS:
#if defined(INET6)
return;
}
- if (q->qclass != CLASS_ANY && q->zone->ns_rrset && answer_needs_ns(q)) {
+ if (q->qclass != CLASS_ANY && q->zone->ns_rrset && answer_needs_ns(q)
+ && !minimal_responses) {
add_rrset(q, answer, OPTIONAL_AUTHORITY_SECTION, q->zone->apex,
q->zone->ns_rrset);
}
{ 12, "ECC-GOST" }, /* RFC 5933 */
{ 13, "ECDSAP256SHA256" }, /* RFC 6605 */
{ 14, "ECDSAP384SHA384" }, /* RFC 6605 */
+ { 15, "ED25519" }, /* RFC 8080 */
+ { 16, "ED448" }, /* RFC 8080 */
{ 252, "INDIRECT" },
{ 253, "PRIVATEDNS" },
{ 254, "PRIVATEOID" },
#ifdef HAVE_MMAP
#include <sys/mman.h>
#endif /* HAVE_MMAP */
+#ifdef HAVE_OPENSSL_RAND_H
#include <openssl/rand.h>
+#endif
#ifndef USE_MINI_EVENT
# ifdef HAVE_EVENT_H
# include <event.h>
void udb_base_link_ptr(udb_base* udb, udb_ptr* ptr)
{
- uint32_t i = chunk_hash_ptr(ptr->data) & udb->ram_mask;
- assert((size_t)i < udb->ram_size);
+ uint32_t i;
#ifdef UDB_CHECK
assert(udb_valid_dataptr(udb, ptr->data)); /* must be to whole chunk*/
#endif
grow_ram_hash(udb, newram);
}
}
+ i = chunk_hash_ptr(ptr->data) & udb->ram_mask;
+ assert((size_t)i < udb->ram_size);
+
ptr->prev = NULL;
ptr->next = udb->ram_hash[i];
udb->ram_hash[i] = ptr;
zone->soa_disk_acquired = xfrd_time();
if(zone->soa_nsd.serial == soa->serial)
zone->soa_nsd_acquired = xfrd_time();
+ xfrd_set_zone_state(zone, xfrd_zone_ok);
+ DEBUG(DEBUG_XFRD,1, (LOG_INFO, "xfrd: zone %s is ok",
+ zone->apex_str));
if(zone->zone_options->pattern->multi_master_check) {
region_destroy(tempregion);
return xfrd_packet_drop;
}
- xfrd_set_zone_state(zone, xfrd_zone_ok);
- DEBUG(DEBUG_XFRD,1, (LOG_INFO, "xfrd: zone %s is ok",
- zone->apex_str));
if(zone->soa_notified_acquired == 0) {
/* not notified or anything, so stop asking around */
zone->round_num = -1; /* next try start a new round */
serial = strtoserial(serialstr, &t);
if (*t != '\0') {
- zc_error_prev_line("serial is expected");
+ zc_error_prev_line("serial is expected or serial too big");
} else {
serial = htonl(serial);
r = alloc_rdata_init(region, &serial, sizeof(serial));