From: Lennart Poettering Date: Wed, 24 Mar 2021 19:36:02 +0000 (+0100) Subject: resolved: don't suppress OPT if we have no OPT X-Git-Tag: v248-2~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=729c5deb2eff2dbd3ecb62146379c132951e6351;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c index abc978ab833..8de407d21ae 100644 --- a/src/resolve/resolved-dns-packet.c +++ b/src/resolve/resolved-dns-packet.c @@ -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