]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Fix: use EDE codes with EDNS_OPT_APPEND_EDE
authorTom Carpay <tom@nlnetlabs.nl>
Mon, 16 Aug 2021 09:59:13 +0000 (09:59 +0000)
committerTom Carpay <tom@nlnetlabs.nl>
Mon, 16 Aug 2021 09:59:13 +0000 (09:59 +0000)
+ complete EDE codes

daemon/worker.c
sldns/rrdef.h

index ec726d87743c17c6bc1fbb0d8fae2a46ebfb4e83..5c324c0cefea77b39da5e2b87e3b7eab9adc623c 100644 (file)
@@ -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?
index f022f93cf9dda7d05b7cf6c9af528da2c748e98c..145c2d95702ef661b3e7bb92cc7502c218b959df 100644 (file)
@@ -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;