-
Notifications
You must be signed in to change notification settings - Fork 17.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: bd7bb2f GitHub-Pull-Request: #53638 Reviewed-on: https://go-review.googlesource.com/c/go/+/415580 Auto-Submit: Damien Neil <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Bryan Mills <[email protected]> Reviewed-by: Damien Neil <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]>
- Loading branch information
Showing
4 changed files
with
19 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters