- Be lenient and accept imgw.pl malformed packet (like BIND).

git-svn-id: file:///svn/unbound/trunk@2339 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards
2010-11-08 18:32:55 +00:00
parent 4e8ae039fa
commit 2fe65ab2b5
4 changed files with 29 additions and 4 deletions
+5 -2
View File
@@ -903,8 +903,11 @@ parse_packet(ldns_buffer* pkt, struct msg_parse* msg, struct regional* region)
if((ret = parse_section(pkt, msg, region, LDNS_SECTION_AUTHORITY,
msg->nscount, &msg->ns_rrsets)) != 0)
return ret;
if((ret = parse_section(pkt, msg, region, LDNS_SECTION_ADDITIONAL,
msg->arcount, &msg->ar_rrsets)) != 0)
if(ldns_buffer_remaining(pkt) == 0 && msg->arcount == 1) {
/* BIND accepts leniently that an EDNS record is missing.
* so, we do too. */
} else if((ret = parse_section(pkt, msg, region,
LDNS_SECTION_ADDITIONAL, msg->arcount, &msg->ar_rrsets)) != 0)
return ret;
/* if(ldns_buffer_remaining(pkt) > 0) { */
/* there is spurious data at end of packet. ignore */