diff options
-rw-r--r-- | pjlib-util/src/pjlib-util/dns.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/pjlib-util/src/pjlib-util/dns.c b/pjlib-util/src/pjlib-util/dns.c index 09d518ed..dccb8f0c 100644 --- a/pjlib-util/src/pjlib-util/dns.c +++ b/pjlib-util/src/pjlib-util/dns.c @@ -326,8 +326,15 @@ static pj_status_t parse_rr(pj_dns_parsed_rr *rr, pj_pool_t *pool, p += 2; /* Class MUST be IN */ - if (rr->dnsclass != 1) - return PJLIB_UTIL_EDNSINCLASS; + if (rr->dnsclass != 1) { + /* Class is not IN, return error only if type is known (see #1889) */ + if (rr->type == PJ_DNS_TYPE_A || rr->type == PJ_DNS_TYPE_AAAA || + rr->type == PJ_DNS_TYPE_CNAME || rr->type == PJ_DNS_TYPE_NS || + rr->type == PJ_DNS_TYPE_PTR || rr->type == PJ_DNS_TYPE_SRV) + { + return PJLIB_UTIL_EDNSINCLASS; + } + } /* Get TTL */ pj_memcpy(&rr->ttl, p, 4); |