summaryrefslogtreecommitdiff
path: root/src/resolve/dns-type.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-12-21 16:23:48 +0100
committerLennart Poettering <lennart@poettering.net>2015-12-26 19:09:09 +0100
commitd3c7e9139c50bec5096925a09b9c1341942c72c4 (patch)
treed4854604f037b756151a03b3c3cbb732677a9f43 /src/resolve/dns-type.c
parent40667ebe74cc5c42bb38e94af06d89ee46dbe839 (diff)
resolved: split out a new dns_type_may_redirect() call
Let's abstract which RRs shall honour CNAMEs, and which ones should not.
Diffstat (limited to 'src/resolve/dns-type.c')
-rw-r--r--src/resolve/dns-type.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/resolve/dns-type.c b/src/resolve/dns-type.c
index cc52ef9abe..0571d65f0b 100644
--- a/src/resolve/dns-type.c
+++ b/src/resolve/dns-type.c
@@ -95,6 +95,25 @@ bool dns_class_is_valid_rr(uint16_t class) {
return class != DNS_CLASS_ANY;
}
+bool dns_type_may_redirect(uint16_t type) {
+ /* The following record types should never be redirected using
+ * CNAME/DNAME RRs. See
+ * <https://tools.ietf.org/html/rfc4035#section-2.5>. */
+
+ if (dns_type_is_pseudo(type))
+ return false;
+
+ return !IN_SET(type,
+ DNS_TYPE_CNAME,
+ DNS_TYPE_DNAME,
+ DNS_TYPE_NSEC3,
+ DNS_TYPE_NSEC,
+ DNS_TYPE_RRSIG,
+ DNS_TYPE_NXT,
+ DNS_TYPE_SIG,
+ DNS_TYPE_KEY);
+}
+
const char *dns_class_to_string(uint16_t class) {
switch (class) {