resolved: fix mistaking QU bit for cache-flush bit
authorSergey Bugaev <bugaevc@gmail.com>
Fri, 19 Feb 2021 13:50:23 +0000 (16:50 +0300)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 6 May 2021 12:05:33 +0000 (14:05 +0200)
commit8496481b9a53ef95bcf680da2959aa927bf67679
tree2877ff5c511ae5c923efd2e9550395b5eeb93202
parentd1271ceeeb938ce7b1aec652ca36ba94330bac64
resolved: fix mistaking QU bit for cache-flush bit

RFC 6762 defines the top bit in RRs to mean cache flush (section 10.2),
and the top bit in questions to mean that a unicast reply is wanted
(section 5.4).

dns_packet_read_key() is used for parsing both questions and RRs.
When called from dns_packet_extract_question(), the top bit being set
should not result in the packet being rejected as invalid.

Fixes https://github.com/systemd/systemd/issues/17973

(cherry picked from commit 82d39576462ba66a4316307ce1ded97272e1245f)
src/resolve/resolved-dns-packet.c
src/resolve/resolved-dns-packet.h
src/resolve/resolved-dns-rr.h
src/resolve/resolved-mdns.c