resolved: don't append RFC6975 data to stub replies
authorLennart Poettering <lennart@poettering.net>
Fri, 9 Oct 2020 14:47:34 +0000 (16:47 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 8 Dec 2020 14:12:45 +0000 (15:12 +0100)
commit8bc375e4010fa51b0bfd4e3fc4f37144b427c2db
tree60b3dcd932879b1f5213b7923c73319f2db4ae0d
parent6d6f14036b945fb18954a46f3bce75c236dd1cce
resolved: don't append RFC6975 data to stub replies

We previously checked the QR bit to decide whether the RFC6975 algorithm
data in our packets. But that doesn't work in many cases, since we
initialize the QR flags along with the other flags usually only after
appending OPT (since success to do so propagates into flags). Hence,
let's add an explicit parameter that controls whether to include RFC6975
data in DNS packets, and set it to false for stub reply, and on true for
upstream queries.

Fixes: #17217
(cherry picked from commit c36d5b5be900315b113a62199274c37fe47a37cd)
src/resolve/resolved-dns-packet.c
src/resolve/resolved-dns-packet.h
src/resolve/resolved-dns-server.c
src/resolve/resolved-dns-stub.c