mirror of
https://github.com/systemd/systemd.git
synced 2025-02-09 13:57:42 +03:00
resolved: if we can't append EDNS OPT RR, then indicate truncation to stub client
We do so for any other RR we can't add, do this here too. Fixes: #11625
This commit is contained in:
parent
acd74d61d2
commit
ff4caaaeba
@ -91,7 +91,14 @@ static int dns_stub_finish_reply_packet(
|
||||
|
||||
assert(p);
|
||||
|
||||
if (!add_opt) {
|
||||
if (add_opt) {
|
||||
r = dns_packet_append_opt(p, ADVERTISE_DATAGRAM_SIZE_MAX, edns0_do, rcode, NULL);
|
||||
if (r == -EMSGSIZE) /* Hit the size limit? then indicate truncation */
|
||||
tc = true;
|
||||
else if (r < 0)
|
||||
return r;
|
||||
|
||||
} else {
|
||||
/* If the client can't to EDNS0, don't do DO either */
|
||||
edns0_do = false;
|
||||
|
||||
@ -117,12 +124,6 @@ static int dns_stub_finish_reply_packet(
|
||||
0 /* cd */,
|
||||
rcode));
|
||||
|
||||
if (add_opt) {
|
||||
r = dns_packet_append_opt(p, ADVERTISE_DATAGRAM_SIZE_MAX, edns0_do, rcode, NULL);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user