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>
Sat, 10 Oct 2020 14:22:22 +0000 (16:22 +0200)
commitc36d5b5be900315b113a62199274c37fe47a37cd
tree47bdfd9276de6dda0da347ccd7dc68d22a052b15
parent5fa661a4fb454110faa0b8bfa69d465c397272f4
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
src/resolve/resolved-dns-packet.c
src/resolve/resolved-dns-packet.h
src/resolve/resolved-dns-server.c
src/resolve/resolved-dns-stub.c