ipn/ipnlocal: randomize DNS query IDs

Allocate a fresh 16-bit ID for each QueryDNS request instead of using the
constant ID 1.

Updates tailscale/corp#48187

Change-Id: I9b47a3fbbef70f0462f1da4f3b29eb77cf31f9f0
Signed-off-by: James Tucker <[email protected]>
(cherry picked from commit 7ad13349f1)
This commit is contained in:
James Tucker committed 2026-11-02 12:03:24 -08:00
1 parent 9b458a4ef4
commit 8a925434dc
1 file changed
+1 -1
+1 -1
View File
@@ -973,7 +973,7 @@ func (b *LocalBackend) QueryDNS(ctx context.Context, name string, queryType dnsm
db := dnsmessage.NewBuilder(nil, dnsmessage.Header{
OpCode: 0,
RecursionDesired: true,
ID: 1,
ID: uint16(rand.IntN(1 << 16)),
})
db.StartQuestions()
db.Question(dnsmessage.Question{