]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.12] net: use network and host as singleflight key during lookupIP
authorCezar Sa Espinola <cezarsa@gmail.com>
Thu, 7 Mar 2019 15:52:16 +0000 (12:52 -0300)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 2 Apr 2019 17:40:15 +0000 (17:40 +0000)
commit578e281583f098c67ad5803ed2db1dad436b54d9
treed297b9213b73d68590873064278bb64bb2cd6106
parent8acc2ea68ba126c6f91afef2545fd6022b039c51
[release-branch.go1.12] net: use network and host as singleflight key during lookupIP

In CL 120215 the cgo resolver was changed to have different logic based
on the network being queried. However, the singleflight cache key wasn't
updated to also include the network. This way it was possible for
concurrent queries to return the result for the wrong network.

This CL changes the key to include both network and host, fixing the
problem.

Fixes #31062

Change-Id: I8b41b0ce1d9a02d18876c43e347654312eba22fc
Reviewed-on: https://go-review.googlesource.com/c/go/+/166037
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit e341bae08d75611adea6566c1d01c1e3a0de57f9)
Reviewed-on: https://go-review.googlesource.com/c/go/+/170320
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/net/lookup.go
src/net/lookup_test.go