resolved: gracefully handle with packets with too large RR count
authorLennart Poettering <lennart@poettering.net>
Tue, 10 Nov 2020 13:48:13 +0000 (14:48 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 17 Feb 2021 17:33:23 +0000 (18:33 +0100)
commitfdfffdaf20a18a50c9a6d858359cf4af6d2f4c8b
tree493983e6771fcb29cbb027d9e9f12d9abb59327b
parent551dd873b0bdfb9e7e47431b2933c8b910228f0c
resolved: gracefully handle with packets with too large RR count

Apparently, there are plenty routers in place that report an incorrect
RR count in the packets: they declare more RRs than are actually
included.

Let's accept these responses, but let's downgrade them to baseline, i.e.
let's suppress OPT in this case: if they don't even get the RR count
right, let's operate on the absolute baseline, and not bother with
anything fancier such as EDNS.

Prompted-by: https://github.com/systemd/systemd/issues/12841#issuecomment-724063973
Fixes: #3980
Most likely fixes: #12841

(cherry picked from commit 18674159ebbf622a9e6e5a45cc36b38f74dae315)
src/resolve/resolved-dns-packet.c