summaryrefslogtreecommitdiff
path: root/src/resolve/dns-type.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-01-11 20:05:29 +0100
committerLennart Poettering <lennart@poettering.net>2016-01-11 20:05:29 +0100
commitd0129ddb9fbb07bed7c8ea51b8031f824bf506fb (patch)
tree9467e4acba84631984450893495e50a9bde15720 /src/resolve/dns-type.c
parent274b874830b93e6592f190608866133384066a35 (diff)
resolved: refuse doing queries for known-obsolete RR types
Given how fragile DNS servers are with some DNS types, and given that we really should avoid confusing them with known-weird lookups, refuse doing lookups for known-obsolete RR types.
Diffstat (limited to 'src/resolve/dns-type.c')
-rw-r--r--src/resolve/dns-type.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/resolve/dns-type.c b/src/resolve/dns-type.c
index 646d98cd46..2522374c33 100644
--- a/src/resolve/dns-type.c
+++ b/src/resolve/dns-type.c
@@ -124,6 +124,33 @@ bool dns_type_is_dnssec(uint16_t type) {
DNS_TYPE_NSEC3PARAM);
}
+bool dns_type_is_obsolete(uint16_t type) {
+ return IN_SET(type,
+ /* Obsoleted by RFC 973 */
+ DNS_TYPE_MD,
+ DNS_TYPE_MF,
+ DNS_TYPE_MAILA,
+
+ /* Kinda obsoleted by RFC 2505 */
+ DNS_TYPE_MB,
+ DNS_TYPE_MG,
+ DNS_TYPE_MR,
+ DNS_TYPE_MINFO,
+ DNS_TYPE_MAILB,
+
+ /* RFC1127 kinda obsoleted this by recommending against its use */
+ DNS_TYPE_WKS,
+
+ /* Declared historical by RFC 6563 */
+ DNS_TYPE_A6,
+
+ /* Obsoleted by DNSSEC-bis */
+ DNS_TYPE_NXT,
+
+ /* RFC 1035 removed support for concepts that needed this from RFC 883 */
+ DNS_TYPE_NULL);
+}
+
const char *dns_class_to_string(uint16_t class) {
switch (class) {