mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-13 13:17:43 +03:00
resolved: set the AA bit for mDNS responses
This is required by RFC 6762. Fixes https://github.com/systemd/systemd/issues/17972
This commit is contained in:
parent
4ad017cda5
commit
bb4e030fcb
@ -883,6 +883,7 @@ int dns_scope_make_reply_packet(
|
|||||||
_cleanup_(dns_packet_unrefp) DnsPacket *p = NULL;
|
_cleanup_(dns_packet_unrefp) DnsPacket *p = NULL;
|
||||||
unsigned n_answer = 0, n_soa = 0;
|
unsigned n_answer = 0, n_soa = 0;
|
||||||
int r;
|
int r;
|
||||||
|
bool c_or_aa;
|
||||||
|
|
||||||
assert(s);
|
assert(s);
|
||||||
assert(ret);
|
assert(ret);
|
||||||
@ -896,11 +897,14 @@ int dns_scope_make_reply_packet(
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
/* mDNS answers must have the Authoritative Answer bit set, see RFC 6762, section 18.4. */
|
||||||
|
c_or_aa = s->protocol == DNS_PROTOCOL_MDNS;
|
||||||
|
|
||||||
DNS_PACKET_HEADER(p)->id = id;
|
DNS_PACKET_HEADER(p)->id = id;
|
||||||
DNS_PACKET_HEADER(p)->flags = htobe16(DNS_PACKET_MAKE_FLAGS(
|
DNS_PACKET_HEADER(p)->flags = htobe16(DNS_PACKET_MAKE_FLAGS(
|
||||||
1 /* qr */,
|
1 /* qr */,
|
||||||
0 /* opcode */,
|
0 /* opcode */,
|
||||||
0 /* c */,
|
c_or_aa,
|
||||||
0 /* tc */,
|
0 /* tc */,
|
||||||
tentative,
|
tentative,
|
||||||
0 /* (ra) */,
|
0 /* (ra) */,
|
||||||
|
Loading…
Reference in New Issue
Block a user