NSEC3s on empty non terminals

bitmap might even not be present.
This commit is contained in:
Willem Toorop 2015-07-04 00:08:03 +02:00
parent 2c09ff2541
commit 682f10b271
1 changed files with 9 additions and 3 deletions

View File

@ -726,9 +726,15 @@ static int nsec_bitmap_excludes_rrtype(getdns_rrset *nsec_rrset, uint16_t rr_typ
return (nsec_rrset->rr_type == GETDNS_RRTYPE_NSEC || return (nsec_rrset->rr_type == GETDNS_RRTYPE_NSEC ||
nsec_rrset->rr_type == GETDNS_RRTYPE_NSEC3 ) nsec_rrset->rr_type == GETDNS_RRTYPE_NSEC3 )
&& (nsec_rr = rrtype_iter_init(&nsec_spc, nsec_rrset)) && (nsec_rr = rrtype_iter_init(&nsec_spc, nsec_rrset))
&& (bitmap = priv_getdns_rdf_iter_init_at(&bitmap_spc, &nsec_rr->rr_i,
/* On empty non terminals there might not be a bitmap
* since that means rrtype is excluded, we must return true then
*/
&& ( !(bitmap = priv_getdns_rdf_iter_init_at(
&bitmap_spc, &nsec_rr->rr_i,
nsec_rrset->rr_type == GETDNS_RRTYPE_NSEC ? 1: 5)) nsec_rrset->rr_type == GETDNS_RRTYPE_NSEC ? 1: 5))
&& !bitmap_has_type(bitmap, rr_type); || !bitmap_has_type(bitmap, rr_type)
);
} }
static int nsec_bitmap_includes_rrtype(getdns_rrset *nsec_rrset, uint16_t rr_type) static int nsec_bitmap_includes_rrtype(getdns_rrset *nsec_rrset, uint16_t rr_type)