summaryrefslogtreecommitdiff
path: root/src/resolve
diff options
context:
space:
mode:
authorDaniel Mack <daniel@zonque.org>2015-09-01 17:17:27 +0200
committerDaniel Mack <daniel@zonque.org>2015-12-08 16:51:40 +0100
commitd84e543d927926fbcc6a5eec730b4db97d9272c7 (patch)
treec5ed23e7536b2ee73c6bcca70e2b9e6eb8840e7a /src/resolve
parent11a27c2ec1f3bdb1df828883365903ce47576c51 (diff)
resolved: allow name compression in NSEC records
Diffstat (limited to 'src/resolve')
-rw-r--r--src/resolve/resolved-dns-packet.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c
index 35d1fb02be..9bd08eeec2 100644
--- a/src/resolve/resolved-dns-packet.c
+++ b/src/resolve/resolved-dns-packet.c
@@ -1819,8 +1819,16 @@ int dns_packet_read_rr(DnsPacket *p, DnsResourceRecord **ret, size_t *start) {
break;
- case DNS_TYPE_NSEC:
- r = dns_packet_read_name(p, &rr->nsec.next_domain_name, false, NULL);
+ case DNS_TYPE_NSEC: {
+
+ /*
+ * RFC6762, section 18.14 explicly states mDNS should use name compression.
+ * This contradicts RFC3845, section 2.1.1
+ */
+
+ bool allow_compressed = p->protocol == DNS_PROTOCOL_MDNS;
+
+ r = dns_packet_read_name(p, &rr->nsec.next_domain_name, allow_compressed, NULL);
if (r < 0)
goto fail;
@@ -1833,7 +1841,7 @@ int dns_packet_read_rr(DnsPacket *p, DnsResourceRecord **ret, size_t *start) {
* without the NSEC bit set. */
break;
-
+ }
case DNS_TYPE_NSEC3: {
uint8_t size;