]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolved: don't suppress OPT if we have no OPT
authorLennart Poettering <lennart@poettering.net>
Wed, 24 Mar 2021 19:36:02 +0000 (20:36 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 25 Mar 2021 02:38:53 +0000 (11:38 +0900)
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

index abc978ab833c6eeaa81a93d489dcb5b290ed3c1e..8de407d21aed6c243668b7c6e46cb22b23101cf5 100644 (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