]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
move a decision from validator to iterator
authorVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 7 Apr 2017 13:56:25 +0000 (15:56 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 7 Apr 2017 13:56:25 +0000 (15:56 +0200)
NS records from AUTHORITY aren't validated.  The iterator seems a
better place, as that's where delegations are handled, etc.

lib/layer/iterate.c
lib/layer/validate.c

index b166de22955fc355307139dbcf0dc52f9af497fe..38fa1a56b911e97588bf975b96a6d2e9dc6dee1c 100644 (file)
@@ -303,7 +303,7 @@ static inline uint8_t get_initial_rank(const knot_rrset_t *rr,
                /* TODO: this classifier of authoritativity may not be perfect yet. */
                return KR_RANK_INITIAL | KR_RANK_AUTH;
        } else {
-               return KR_RANK_INITIAL;
+               return rr->type == KNOT_RRTYPE_NS ? KR_RANK_OMIT : KR_RANK_INITIAL;
        }
 }
 
index c4a54ce96615a6525695c13a542ab25249b73346..af5bb4b67bc74a63408174b3bb605a49b99be881 100644 (file)
@@ -111,10 +111,7 @@ static int validate_section(kr_rrset_validation_ctx_t *vctx, knot_mm_t *pool)
                        kr_rank_set(&entry->rank, KR_RANK_OMIT);
                        continue;
                }
-               if ((rr->type == KNOT_RRTYPE_NS) && (vctx->section_id == KNOT_AUTHORITY)) {
-                       kr_rank_set(&entry->rank, KR_RANK_OMIT);
-                       continue;
-               }
+
                validation_result = kr_rrset_validate(vctx, rr);
                if (validation_result == kr_ok()) {
                        kr_rank_set(&entry->rank, KR_RANK_SECURE);