mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-24 00:29:58 -05:00
Fixup.
git-svn-id: file:///svn/unbound/trunk@4965 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
7458729d28
commit
022d5131b3
1 changed files with 14 additions and 18 deletions
|
|
@ -316,6 +316,18 @@ sub_of_pkt(sldns_buffer* pkt, uint8_t* zone, uint8_t* comprname)
|
||||||
return dname_subdomain_c(zone, buf);
|
return dname_subdomain_c(zone, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Check if there are SOA records in the authority section (negative) */
|
||||||
|
static int
|
||||||
|
soa_in_auth(struct msg_parse* msg)
|
||||||
|
{
|
||||||
|
struct rrset_parse* rrset;
|
||||||
|
for(rrset = msg->rrset_first; rrset; rrset = rrset->rrset_all_next)
|
||||||
|
if(rrset->type == LDNS_RR_TYPE_SOA &&
|
||||||
|
rrset->section == LDNS_SECTION_AUTHORITY)
|
||||||
|
return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This routine normalizes a response. This includes removing "irrelevant"
|
* This routine normalizes a response. This includes removing "irrelevant"
|
||||||
* records from the answer and additional sections and (re)synthesizing
|
* records from the answer and additional sections and (re)synthesizing
|
||||||
|
|
@ -502,14 +514,10 @@ scrub_normalize(sldns_buffer* pkt, struct msg_parse* msg,
|
||||||
* from. eg. fragmentation attacks, inserted after
|
* from. eg. fragmentation attacks, inserted after
|
||||||
* long RRSIGs in the packet get to the packet
|
* long RRSIGs in the packet get to the packet
|
||||||
* border and such */
|
* border and such */
|
||||||
/* also for NODATA answers
|
/* also for NODATA answers */
|
||||||
* (nodata has an empty answer section, ie. the
|
|
||||||
* first rr is from the next section */
|
|
||||||
if(FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NXDOMAIN ||
|
if(FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NXDOMAIN ||
|
||||||
(FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NOERROR
|
(FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NOERROR
|
||||||
&& (msg->rrset_first->section == LDNS_SECTION_AUTHORITY
|
&& soa_in_auth(msg) && msg->an_rrsets == 0)) {
|
||||||
|| msg->rrset_first->section == LDNS_SECTION_ADDITIONAL)
|
|
||||||
)) {
|
|
||||||
remove_rrset("normalize: removing irrelevant "
|
remove_rrset("normalize: removing irrelevant "
|
||||||
"RRset:", pkt, msg, prev, &rrset);
|
"RRset:", pkt, msg, prev, &rrset);
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -612,18 +620,6 @@ store_rrset(sldns_buffer* pkt, struct msg_parse* msg, struct module_env* env,
|
||||||
(void)rrset_cache_update(env->rrset_cache, &ref, env->alloc, now);
|
(void)rrset_cache_update(env->rrset_cache, &ref, env->alloc, now);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if there are SOA records in the authority section (negative) */
|
|
||||||
static int
|
|
||||||
soa_in_auth(struct msg_parse* msg)
|
|
||||||
{
|
|
||||||
struct rrset_parse* rrset;
|
|
||||||
for(rrset = msg->rrset_first; rrset; rrset = rrset->rrset_all_next)
|
|
||||||
if(rrset->type == LDNS_RR_TYPE_SOA &&
|
|
||||||
rrset->section == LDNS_SECTION_AUTHORITY)
|
|
||||||
return 1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if right hand name in NSEC is within zone
|
* Check if right hand name in NSEC is within zone
|
||||||
* @param rrset: the NSEC rrset
|
* @param rrset: the NSEC rrset
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue