resolved: don't suppress OPT if we have no OPT

This is inspired by #18917. It suppresses a misleading log message about
suppressing OPT where we might not actually have OPT.
This commit is contained in:
Lennart Poettering
2021-03-24 20:36:02 +01:00
committed by Yu Watanabe
parent a2c69debd9
commit 729c5deb2e

View File

@@ -2271,7 +2271,7 @@ static int dns_packet_extract_answer(DnsPacket *p, DnsAnswer **ret_answer) {
bool cache_flush = false;
size_t start;
if (p->rindex == p->size) {
if (p->rindex == p->size && p->opt) {
/* If we reached the end of the packet already, but there are still more RRs
* declared, then that's a corrupt packet. Let's accept the packet anyway, since it's
* apparently a common bug in routers. Let's however suppress OPT support in this