resolved: extend list of pseudo RR types

Also, explain the situation with a longer comment.
This commit is contained in:
Lennart Poettering
2015-12-11 14:13:31 +01:00
parent c57d67f718
commit bea4c76fa0
+18 -3
View 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
);
}