]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolved: extend list of pseudo RR types
authorLennart Poettering <lennart@poettering.net>
Thu, 10 Dec 2015 12:27:58 +0000 (13:27 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 11 Dec 2015 13:13:31 +0000 (14:13 +0100)
Also, explain the situation with a longer comment.

src/resolve/dns-type.c

index a626ecf01ac7edd74f697c9e97f8cfa664289535..393fee035627716adb98444efb570afd9d37da62 100644 (file)
@@ -44,7 +44,22 @@ int dns_type_from_string(const char *s) {
         return sc->id;
 }
 
-/* XXX: find an authoritative list of all pseudo types? */
-bool dns_type_is_pseudo(uint16_t n) {
-        return IN_SET(n, DNS_TYPE_ANY, DNS_TYPE_AXFR, DNS_TYPE_IXFR, DNS_TYPE_OPT);
+bool dns_type_is_pseudo(uint16_t type) {
+
+        /* Checks whether the specified type is a "pseudo-type". What
+         * a "pseudo-type" precisely is, is defined only very weakly,
+         * but apparently entails all RR types that are not actually
+         * stored as RRs on the server and should hence also not be
+         * cached. We use this list primarily to validate NSEC type
+         * bitfields. */
+
+        return IN_SET(type,
+                      0, /* A Pseudo RR type, according to RFC 2931 */
+                      DNS_TYPE_ANY,
+                      DNS_TYPE_AXFR,
+                      DNS_TYPE_IXFR,
+                      DNS_TYPE_OPT,
+                      DNS_TYPE_TSIG,
+                      DNS_TYPE_TKEY
+        );
 }