diff options
| author | Zeke Lu <lvzecai@gmail.com> | 2022-10-27 01:43:16 +0000 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2022-11-02 18:42:50 +0000 |
| commit | c53390b078b4d3b18e3aca8970d4b31d4d82cce1 (patch) | |
| tree | c4bdb46e46cf23c82defffd383ca83032c366446 /src/os/exec/exec_test.go | |
| parent | 07a70bcabb3c81a2f97e894a6910d95b19d6b074 (diff) | |
| download | go-c53390b078b4d3b18e3aca8970d4b31d4d82cce1.tar.xz | |
net: store IPv4 returned from cgo resolver as 4-byte slice net.IP
net.IP states that a 16-byte slice can still be an IPv4 address.
But after netip.Addr is introduced, it requires extra care to keep
it as an IPv4 address when converting it to a netip.Addr using
netip.AddrFromSlice.
To address this issue, let's change the cgo resolver to return
4-byte net.IP for IPv4. The change will save us 12 bytes too.
Please note that the go resolver already return IPv4 as 4-byte
slice.
The test TestResolverLookupIP has been modified to cover this
behavior. So no new test is added.
Fixes #53554.
Change-Id: I0dc2a59ad785c0c67a7bc22433105529f055997f
GitHub-Last-Rev: bd7bb2f17bd8e07ea5b39e4a24512ed35d316bb8
GitHub-Pull-Request: golang/go#53638
Reviewed-on: https://go-review.googlesource.com/c/go/+/415580
Auto-Submit: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/os/exec/exec_test.go')
0 files changed, 0 insertions, 0 deletions
