From: Tom Carpay Date: Mon, 16 Aug 2021 09:59:13 +0000 (+0000) Subject: Fix: use EDE codes with EDNS_OPT_APPEND_EDE X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0703a38243a614896a9dea573605e434e1c9cc33;p=thirdparty%2Funbound.git Fix: use EDE codes with EDNS_OPT_APPEND_EDE + complete EDE codes --- diff --git a/daemon/worker.c b/daemon/worker.c index ec726d877..5c324c0ce 100644 --- a/daemon/worker.c +++ b/daemon/worker.c @@ -1291,7 +1291,7 @@ worker_handle_request(struct comm_point* c, void* arg, int error, edns.bits &= EDNS_DO; edns.opt_list = NULL; EDNS_OPT_APPEND_EDE(&edns, worker->scratchpad, - LDNS_EDNS_EDE, "query with bad edns keepalive"); + LDNS_EDE_OTHER, "query with bad edns keepalive"); verbose(VERB_ALGO, "query with bad edns keepalive."); log_addr(VERB_CLIENT,"from",&repinfo->addr, repinfo->addrlen); error_encode(c->buffer, LDNS_RCODE_FORMERR, &qinfo, @@ -1410,8 +1410,8 @@ worker_handle_request(struct comm_point* c, void* arg, int error, // @TODO ADD Error Code 20 - Not Authoritative // @TODO add EDNS record - EDNS_OPT_APPEND_EDE(&edns, worker->scratchpad, LDNS_EDNS_EDE, - "Not Authoritative"); + EDNS_OPT_APPEND_EDE(&edns, worker->scratchpad, + LDNS_EDE_NOT_AUTHORITATIVE, "Not Authoritative"); @@ -1505,7 +1505,7 @@ lookup_cache: // *worker->env.now >= ((struct reply_info*)e->data)->ttl) { // // EDE Error Code 3 - Stale Answer // EDNS_OPT_APPEND_EDE(&edns, worker->scratchpad, - // LDNS_EDNS_EDE, "query with bad edns keepalive."); + // LDNS_EDE_STALE_ANSWER, ""); // } // add EDNS struct? diff --git a/sldns/rrdef.h b/sldns/rrdef.h index f022f93cf..145c2d957 100644 --- a/sldns/rrdef.h +++ b/sldns/rrdef.h @@ -437,7 +437,29 @@ enum sldns_enum_ede_code { LDNS_EDE_OTHER = 0, LDNS_EDE_UNSUPPORTED_DNSKEY_ALG = 1, - LDNS_EDE_UNSUPPORTED_DS_DIGEST = 2 + LDNS_EDE_UNSUPPORTED_DS_DIGEST = 2, + LDNS_EDE_STALE_ANSWER = 3, + LDNS_EDE_FORGED_ANSWER = 4, + LDNS_EDE_DNSSEC_INDETERMINATE = 5, + LDNS_EDE_DNSSEC_BOGUS = 6, + LDNS_EDE_SIGNATURE_EXPIRED = 7, + LDNS_EDE_SIGNATURE_NOT_YET_VALID = 8, + LDNS_EDE_DNSKEY_MISSING = 9, + LDNS_EDE_RRSIGS_MISSING = 10, + LDNS_EDE_NO_ZONE_KEY_BIT_SET = 11, + LDNS_EDE_NSEC_MISSING = 12, + LDNS_EDE_CACHED_ERROR = 13, + LDNS_EDE_NOT_READY = 14, + LDNS_EDE_BLOCKED = 15, + LDNS_EDE_CENSORED = 16, + LDNS_EDE_FILTERED = 17, + LDNS_EDE_PROHIBITED = 18, + LDNS_EDE_STALE_NXDOMAIN_ANSWER = 19, + LDNS_EDE_NOT_AUTHORITATIVE = 20, + LDNS_EDE_NOT_SUPPORTED = 21, + LDNS_EDE_NO_REACHABLE_AUTHORITY = 22, + LDNS_EDE_NETWORK_ERROR = 23, + LDNS_EDE_INVALID_DATA = 24 }; typedef enum sldns_enum_ede_code sldns_ede_code;