summaryrefslogtreecommitdiffstats
path: root/src/resolve/resolved-dns-packet.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-01-07 12:42:48 +0100
committerLennart Poettering <lennart@poettering.net>2016-01-11 19:39:58 +0100
commit35b011ed7c108b3e3c67f641afdf75ca6c5a621e (patch)
treede34fa9d803ddca6c8735135774eacee7a299cb9 /src/resolve/resolved-dns-packet.c
parentresolved: rename suffix_rr → zone_rr (diff)
downloadsystemd-35b011ed7c108b3e3c67f641afdf75ca6c5a621e.tar.xz
systemd-35b011ed7c108b3e3c67f641afdf75ca6c5a621e.zip
resolved: be less strict where the OPT pseudo-RR is placed
This increases compatibility with crappy Belkin routers.
Diffstat (limited to '')
-rw-r--r--src/resolve/resolved-dns-packet.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c
index 4750bf1f5d..8a360a29fb 100644
--- a/src/resolve/resolved-dns-packet.c
+++ b/src/resolve/resolved-dns-packet.c
@@ -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) {