]> Cypherpunks repositories - gostls13.git/commit
net: prefer error for original name on lookups
authorDan Peterson <dpiddy@gmail.com>
Thu, 19 Nov 2015 19:24:42 +0000 (15:24 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 17 Dec 2015 15:17:06 +0000 (15:17 +0000)
commit5c0629b503ff9044906a785f360354a5e45cf9ce
tree703f9640ab46cb879bddd951e253555af602e596
parentbe7544be237b279e45be73963e84ab59916b8ac2
net: prefer error for original name on lookups

With certain names and search domain configurations the
returned error would be one encountered while querying a
generated name instead of the original name. This caused
confusion when a manual check of the same name produced
different results.

Now prefer errors encountered for the original name.

Also makes the low-level DNS connection plumbing swappable
in tests enabling tighter control over responses without
relying on the network.

Fixes #12712
Updates #13295

Change-Id: I780d628a762006bb11899caf20b5f97b462a717f
Reviewed-on: https://go-review.googlesource.com/16953
Reviewed-by: Russ Cox <rsc@golang.org>
src/net/dnsclient_unix.go
src/net/dnsclient_unix_test.go
src/net/hook.go