summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-scope.c
diff options
context:
space:
mode:
authorDaniel Mack <daniel@zonque.org>2015-12-10 15:59:30 +0100
committerDaniel Mack <daniel@zonque.org>2015-12-10 16:32:03 +0100
commitfe2dfc8b4947451f87fcae56f839ca84dde26453 (patch)
tree341fd1392213487ce4ff8ab951ebc88f4a7d9ec9 /src/resolve/resolved-dns-scope.c
parent40fa4728eb0de88719c288aaf8793a37c1bb84f9 (diff)
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.
Diffstat (limited to 'src/resolve/resolved-dns-scope.c')
-rw-r--r--src/resolve/resolved-dns-scope.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/resolve/resolved-dns-scope.c b/src/resolve/resolved-dns-scope.c
index 4d83ac597c..bf49c51b5d 100644
--- a/src/resolve/resolved-dns-scope.c
+++ b/src/resolve/resolved-dns-scope.c
@@ -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);