resolved: rr - ignore pseudo types in NSEC(3) bitmaps

This commit is contained in:
Tom Gundersen 2015-07-23 13:48:56 +02:00
parent 0bbd72b2f3
commit 8e6edc490c
3 changed files with 10 additions and 1 deletions

View file

@ -43,3 +43,8 @@ int dns_type_from_string(const char *s) {
return sc->id;
}
/* XXX: find an authorotative list of all pseudo types? */
bool dns_type_is_pseudo(int n) {
return IN_SET(n, DNS_TYPE_ANY, DNS_TYPE_AXFR, DNS_TYPE_IXFR, DNS_TYPE_OPT);
}

View file

@ -25,6 +25,7 @@
const char *dns_type_to_string(int type);
int dns_type_from_string(const char *s);
bool dns_type_is_pseudo(int n);
/* DNS record types, taken from
* http://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml.

View file

@ -1208,9 +1208,12 @@ static int dns_packet_read_type_window(DnsPacket *p, Bitmap **types, size_t *sta
if (bitmap[i] & bitmask) {
uint16_t n;
/* XXX: ignore pseudo-types? see RFC4034 section 4.1.2 */
n = (uint16_t) window << 8 | (uint16_t) bit;
/* Ignore pseudo-types. see RFC4034 section 4.1.2 */
if (dns_type_is_pseudo(n))
continue;
r = bitmap_set(*types, n);
if (r < 0)
goto fail;