mirror of
https://github.com/systemd/systemd.git
synced 2025-03-22 06:50:18 +03:00
resolved: make sure the packet's transaction ID is always 0 for mDNS
RFC6762, 18.1: In multicast query messages, the Query Identifier SHOULD be set to zero on transmission.
This commit is contained in:
parent
40fa4728eb
commit
fe2dfc8b49
@ -818,7 +818,11 @@ static int dns_scope_make_conflict_packet(
|
||||
0 /* (ad) */,
|
||||
0 /* (cd) */,
|
||||
0));
|
||||
random_bytes(&DNS_PACKET_HEADER(p)->id, sizeof(uint16_t));
|
||||
|
||||
/* For mDNS, the transaction ID should always be 0 */
|
||||
if (s->protocol != DNS_PROTOCOL_MDNS)
|
||||
random_bytes(&DNS_PACKET_HEADER(p)->id, sizeof(uint16_t));
|
||||
|
||||
DNS_PACKET_HEADER(p)->qdcount = htobe16(1);
|
||||
DNS_PACKET_HEADER(p)->arcount = htobe16(1);
|
||||
|
||||
|
@ -819,7 +819,6 @@ static int dns_transaction_make_packet_mdns(DnsTransaction *t) {
|
||||
}
|
||||
|
||||
DNS_PACKET_HEADER(p)->qdcount = htobe16(qdcount);
|
||||
DNS_PACKET_HEADER(p)->id = t->id;
|
||||
|
||||
/* Append known answer section if we're asking for any shared record */
|
||||
if (add_known_answers) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user