net = { '{{SELF_ADDR}}' }
+{% if DO_IP6 == "true" %}
+net.ipv6 = true
+{% else %}
+net.ipv6 = false
+{% endif %}
+
+{% if DO_IP4 == "true" %}
+net.ipv4 = true
+{% else %}
+net.ipv4 = false
+{% endif %}
+
{% if QMIN == "false" %}
option('NO_MINIMIZE', true)
qry->flags.RESOLVED = false;
}
- /* For multiple errors in a row; invalidate_ns() is not enough. */
if (!qry->flags.CACHED) {
if (request->state & KR_STATE_FAIL) {
if (++request->count_fail_row > KR_CONSUME_FAIL_ROW_LIMIT) {
trie_t *addresses;
unsigned int generation; // Used to distinguish old and valid records in tries
enum kr_selection_error last_error;
+ unsigned int no_ns_addr_count;
};
enum record_state {
}
}
+ bool nxnsattack_mitigation = false;
+ enum kr_transport_protocol proto = *transport ? (*transport)->protocol : -1;
+ if (proto == KR_TRANSPORT_RESOLVE_A || proto == KR_TRANSPORT_RESOLVE_AAAA) {
+ if (++local_state->no_ns_addr_count > KR_COUNT_NO_NSADDR_LIMIT) {
+ *transport = NULL;
+ nxnsattack_mitigation = true;
+ }
+ }
+
update_name_state(*transport, local_state->names);
WITH_VERBOSE(qry) {
if (*transport) {
KR_DNAME_GET_STR(ns_name, (*transport)->name);
const char *ns_str = kr_straddr(&(*transport)->address.ip);
- enum kr_transport_protocol proto = (*transport)->protocol;
if (proto != KR_TRANSPORT_RESOLVE_A && proto != KR_TRANSPORT_RESOLVE_AAAA) {
VERBOSE_MSG(qry,
"=> id: '%05u' choosing: '%s'@'%s' with timeout %u ms zone cut: '%s'%s\n",
}
} else {
VERBOSE_MSG(qry,
- "=> id: '%05u' no suitable transport, zone cut: '%s'\n",
- qry->id, zonecut_str);
+ "=> id: '%05u' no suitable transport, zone cut: '%s'%s\n",
+ qry->id, zonecut_str, nxnsattack_mitigation ? " (stopped due to mitigation for NXNSAttack CVE-2020-12667)" : "");
}
}
}