]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
debugprint for wrongly_truncated
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 29 Jun 2009 08:52:58 +0000 (08:52 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 29 Jun 2009 08:52:58 +0000 (08:52 +0000)
git-svn-id: file:///svn/unbound/trunk@1685 be551aaa-1e26-0410-a405-d3ace91eadb9

validator/validator.c

index bf97e9f978ef5a7e8ce7bc40bc85dcce6729be5c..141a98acac20ac6fe0b60f433dfca46b128ba56b 100644 (file)
@@ -479,7 +479,8 @@ validate_msg_signatures(struct module_env* env, struct val_env* ve,
 }
 
 /**
- * Detect wrong truncated response (from BIND 9.6.1 with minimal-responses).
+ * Detect wrong truncated response (say from BIND 9.6.1 that is forwarding
+ * and saw the NS record without signatures from a referral).
  * The positive response has a mangled authority section.
  * Remove that authority section.
  * @param rep: reply
@@ -489,12 +490,25 @@ static int
 detect_wrongly_truncated(struct reply_info* rep)
 {
        size_t i;
+       /* DEBUG printout */
+       log_info("detect_wrongly_truncated debug printout");
+       log_info("rep an %d ns %d ar %d c %d", (int)rep->an_numrrsets,
+               (int)rep->ns_numrrsets, (int)rep->ar_numrrsets,
+               (int)rep->rrset_count);
+
        /* no additional, only NS in authority, and it is bogus */
        if(rep->ar_numrrsets != 0 || rep->ns_numrrsets != 1 ||
                rep->an_numrrsets == 0)
                return 0;
        if(ntohs(rep->rrsets[ rep->an_numrrsets ]->rk.type) != LDNS_RR_TYPE_NS)
                return 0;
+       log_nametypeclass(0, "NSRR", rep->rrsets[ rep->an_numrrsets ]->rk.dname,
+               ntohs(rep->rrsets[ rep->an_numrrsets ]->rk.type), 
+               ntohs(rep->rrsets[ rep->an_numrrsets ]->rk.rrset_class));
+       log_info("sec %d %s", ((struct packed_rrset_data*)rep->rrsets[ 
+               rep->an_numrrsets ] ->entry.data)->security,
+               sec_status_to_string(((struct packed_rrset_data*)rep->rrsets[ 
+               rep->an_numrrsets ] ->entry.data)->security));
        if(((struct packed_rrset_data*)rep->rrsets[ rep->an_numrrsets ]
                ->entry.data)->security != sec_status_bogus)
                return 0;