summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-stub.c
diff options
context:
space:
mode:
authorKoyamaSohei <koyamaso0309@gmail.com>2021-04-04 01:13:37 +0900
committerLennart Poettering <lennart@poettering.net>2021-04-06 17:00:29 +0200
commitda846b30312863cc30b32c1d43988a44673c5b8f (patch)
tree2e1aab8a619b8fff143f8d527d11153d6f1bff19 /src/resolve/resolved-dns-stub.c
parentf34173a048061b3f7e551e9a7c04f00e5a106fac (diff)
downloadsystemd-da846b30312863cc30b32c1d43988a44673c5b8f.tar.gz
resolve: copy rd flag from the query to response
Diffstat (limited to 'src/resolve/resolved-dns-stub.c')
-rw-r--r--src/resolve/resolved-dns-stub.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/resolve/resolved-dns-stub.c b/src/resolve/resolved-dns-stub.c
index 602720bf50..f82a997c18 100644
--- a/src/resolve/resolved-dns-stub.c
+++ b/src/resolve/resolved-dns-stub.c
@@ -433,6 +433,7 @@ static int dns_stub_finish_reply_packet(
int rcode,
bool tc, /* set the Truncated bit? */
bool aa, /* set the Authoritative Answer bit? */
+ bool rd, /* set the Recursion Desired bit? */
bool add_opt, /* add an OPT RR to this packet? */
bool edns0_do, /* set the EDNS0 DNSSEC OK bit? */
bool ad, /* set the DNSSEC authenticated data bit? */
@@ -473,7 +474,7 @@ static int dns_stub_finish_reply_packet(
0 /* opcode */,
aa /* aa */,
tc /* tc */,
- 1 /* rd */,
+ rd /* rd */,
1 /* ra */,
ad /* ad */,
cd /* cd */,
@@ -581,6 +582,7 @@ static int dns_stub_send_reply(
rcode,
truncated,
dns_query_fully_authoritative(q),
+ DNS_PACKET_RD(q->request_packet),
!!q->request_packet->opt,
edns0_do,
DNS_PACKET_AD(q->request_packet) && dns_query_fully_authenticated(q),
@@ -622,6 +624,7 @@ static int dns_stub_send_failure(
rcode,
truncated,
false,
+ DNS_PACKET_RD(p),
!!p->opt,
DNS_PACKET_DO(p),
DNS_PACKET_AD(p) && authenticated,