diff options
| author | Bryan C. Mills <bcmills@google.com> | 2021-11-23 10:27:30 -0500 |
|---|---|---|
| committer | Bryan Mills <bcmills@google.com> | 2021-12-07 02:31:12 +0000 |
| commit | e07b02ff87af594a68484dcb1e3a78d1c39abc56 (patch) | |
| tree | 3b5c45daf55f78d2ee2c9336346df4b23c0077d6 /src/runtime | |
| parent | 0eb39ca1f0ca118e78648fb6844d35d0a96e5eee (diff) | |
| download | go-e07b02ff87af594a68484dcb1e3a78d1c39abc56.tar.xz | |
net: in (*netFD).dial, use the passed in local address if getsockname fails
'man getsockname' lists a number of possible failure modes, including
ENOBUFS (for resource exhaustion) and EBADF (which we could possibly
see in the event of a bug or race condition elsewhere in the program).
If getsockname fails for an explicit user-provided local address, the
user is probably not expecting LocalAddr on the returned net.Conn to
return nil. This may or may not fix #34611, but should at least help
us diagnose it more clearly.
While we're add it, also add more nil-checking logic in the test based
on the stack traces posted to
https://golang.org/issue/34611#issuecomment-975923748.
For #34611
Change-Id: Iba870b96787811e4b9959b74ef648afce9316602
Reviewed-on: https://go-review.googlesource.com/c/go/+/366536
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/runtime')
0 files changed, 0 insertions, 0 deletions
