]> Cypherpunks repositories - gostls13.git/commit
net: use libSystem bindings for DNS resolution on macos if cgo is unavailable
authorgrant <grantseltzer@gmail.com>
Wed, 3 Apr 2019 14:21:21 +0000 (14:21 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 4 Apr 2019 19:36:23 +0000 (19:36 +0000)
commitf6b42a53e5ac1f1c3f3b1c9ed2407e68e0b637a0
treebead0728b77cc1ea3f0c1df709634743d7933398
parentbead358611e36fe0991c171a8a4a4924f4f0e584
net: use libSystem bindings for DNS resolution on macos if cgo is unavailable

This change adds directives to link the res_search function in libSystem.
The corresponding Go function is then used in `lookup_darwin.go` for
resolution when cgo is disabled. This makes DNS resolution logic more
reliable as macOS has some unique quirks such as the `/etc/resolver/`
directory for specifying nameservers.

Fixes #12524

Change-Id: I367263c4951383965b3ef6491196152f78e614b1
GitHub-Last-Rev: 3c3ff6bfa7e4811f206f3b119a867c841a016e10
GitHub-Pull-Request: golang/go#30686
Reviewed-on: https://go-review.googlesource.com/c/go/+/166297
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/net/cgo_darwin_stub.go [new file with mode: 0644]
src/net/cgo_stub.go
src/net/conf.go
src/runtime/lookup_darwin.go [new file with mode: 0644]
src/runtime/lookup_darwin_386.s [new file with mode: 0644]
src/runtime/lookup_darwin_amd64.s [new file with mode: 0644]
src/runtime/lookup_darwin_arm.s [new file with mode: 0644]
src/runtime/lookup_darwin_arm64.s [new file with mode: 0644]