]> Cypherpunks repositories - gostls13.git/commit
net: force LookupAddr results to be rooted DNS paths when using cgo
authorRuss Cox <rsc@golang.org>
Wed, 19 Aug 2015 02:19:58 +0000 (22:19 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 19 Aug 2015 04:20:27 +0000 (04:20 +0000)
commit18d27b2d754923854e05c3b37a2b799d9c063164
tree417a56728cd9298f9fb278ca0c76b1d8f8260b5b
parentb711f5ad8f945a6c8e823cb1e7fc65eafdb3a3e4
net: force LookupAddr results to be rooted DNS paths when using cgo

Go 1.4 and before have always returned DNS names with a trailing dot
for reverse lookups, as they do for basically all other routines returning
DNS names. Go 1.4 and before always implemented LookupAddr using
pure Go (not C library calls).

Go 1.5 added the ability to make a C library call to implement LookupAddr.
Unfortunately the C library call returns a DNS name without a trailing dot
(an unrooted name), meaning that if turn off cgo during make.bash then
you still get the rooted name but with cgo on you get an unrooted name.
The unrooted name is inconsistent with the pure Go implementation
and with all previous Go releases, so change it to a rooted name.

Fixes #12189.

Change-Id: I3d6b72277c121fe085ea6af30e5fe8019fc490ad
Reviewed-on: https://go-review.googlesource.com/13697
Reviewed-by: Rob Pike <r@golang.org>
src/net/cgo_unix.go
src/net/lookup_test.go
src/net/non_unix_test.go [new file with mode: 0644]
src/net/unix_test.go