]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolved: do not reject NSEC records with empty bitmaps
authorTom Gundersen <teg@jklm.no>
Wed, 25 Nov 2015 21:22:38 +0000 (22:22 +0100)
committerTom Gundersen <teg@jklm.no>
Thu, 26 Nov 2015 03:03:08 +0000 (04:03 +0100)
The assumption that no NSEC bitmap could be empty due to the presence of the bit representing
the record itself turns out to be flawed. See (the admittedly experimental) RFC4956 for a
counter example.

src/resolve/resolved-dns-packet.c

index 472486777c1e3d7482dc87561a6d18239fd4cbfc..4b6b6afae8b6828ce71d273dd3a20024837b14aa 100644 (file)
@@ -1746,12 +1746,9 @@ int dns_packet_read_rr(DnsPacket *p, DnsResourceRecord **ret, size_t *start) {
                 if (r < 0)
                         goto fail;
 
-                /* The types bitmap must contain at least the NSEC record itself, so an empty bitmap means
-                   something went wrong */
-                if (bitmap_isclear(rr->nsec.types)) {
-                        r = -EBADMSG;
-                        goto fail;
-                }
+                /* We accept empty NSEC bitmaps. The bit indicating the presence of the NSEC record itself
+                 * is redundant and in e.g., RFC4956 this fact is used to define a use for NSEC records
+                 * without the NSEC bit set. */
 
                 break;