From 381600bfd98700b08fc4a768c5d078c5e22e50a1 Mon Sep 17 00:00:00 2001 From: gVisor bot Date: Mon, 12 Jun 2023 10:01:13 +0000 Subject: [PATCH] fix: dns concurrent not work --- dns/util.go | 1 + 1 file changed, 1 insertion(+) diff --git a/dns/util.go b/dns/util.go index 2ba4d426..edd26a42 100644 --- a/dns/util.go +++ b/dns/util.go @@ -291,6 +291,7 @@ func batchExchange(ctx context.Context, clients []dnsClient, m *D.Msg) (msg *D.M fast, ctx := picker.WithTimeout[*D.Msg](ctx, resolver.DefaultDNSTimeout) domain := msgToDomain(m) for _, client := range clients { + client := client // shadow define client to ensure the value captured by the closure will not be changed in the next loop _, cache = client.(rcodeClient) cache = !cache fast.Go(func() (*D.Msg, error) {