forked from golang/go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net: fix parsing literal IP addresses in local database
This change fixes incorrect parsing of literal IP addresses in local database when the addresses contain IPv6 zone identifiers, are in dotted-decimal notation or in colon-hexadecimal notation with leading zeros. https://golang.org/cl/5851 already fixed the code path using getaddrinfo via cgo. This change fixes the remaining non-cgo code path. Fixes golang#8243. Fixes golang#8996. Change-Id: I48443611cbabed0d69667cc73911ba3de396fd44 Reviewed-on: https://go-review.googlesource.com/10306 Reviewed-by: Brad Fitzpatrick <[email protected]>
- Loading branch information
Showing
6 changed files
with
148 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# See https://tools.ietf.org/html/rfc1123. | ||
# | ||
# The literal IPv4 address parser in the net package is a relaxed | ||
# one. It may accept a literal IPv4 address in dotted-decimal notation | ||
# with leading zeros such as "001.2.003.4". | ||
|
||
# internet address and host name | ||
127.0.0.1 localhost # inline comment separated by tab | ||
127.000.000.002 localhost # inline comment separated by space | ||
|
||
# internet address, host name and aliases | ||
127.000.000.003 localhost localhost.localdomain |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# See https://tools.ietf.org/html/rfc5952, https://tools.ietf.org/html/rfc4007. | ||
|
||
# internet address and host name | ||
::1 localhost # inline comment separated by tab | ||
fe80:0000:0000:0000:0000:0000:0000:0001 localhost # inline comment separated by space | ||
|
||
# internet address with zone identifier and host name | ||
fe80:0000:0000:0000:0000:0000:0000:0002%lo0 localhost | ||
|
||
# internet address, host name and aliases | ||
fe80::3%lo0 localhost localhost.localdomain |
File renamed without changes.