resolved: be less strict where the OPT pseudo-RR is placed

This increases compatibility with crappy Belkin routers.
This commit is contained in:
Lennart Poettering 2016-01-07 12:42:48 +01:00
parent 7e35195fe3
commit 35b011ed7c
1 changed files with 6 additions and 5 deletions

View File

@ -2089,11 +2089,12 @@ int dns_packet_extract(DnsPacket *p) {
goto finish;
}
/* The OPT RR is only valid in the Additional section */
if (i < DNS_PACKET_ANCOUNT(p) + DNS_PACKET_NSCOUNT(p)) {
r = -EBADMSG;
goto finish;
}
/* Note that we accept the OPT RR in
* any section, not just in the
* additional section, as some routers
* (Belkin!) blindly copy the OPT RR
* from the query to the reply packet,
* and don't get the section right. */
/* Two OPT RRs? */
if (p->opt) {