From 729c5deb2eff2dbd3ecb62146379c132951e6351 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 24 Mar 2021 20:36:02 +0100 Subject: [PATCH] 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. --- src/resolve/resolved-dns-packet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.47.3