summaryrefslogtreecommitdiff
path: root/src/internal/syscall/unix/net_darwin.go
Commit message (Collapse)AuthorAgeFilesLines
* net: use and assert correct res state size at compile time when cgo ↵Mateusz Poliwczak2023-05-161-1/+1
| | | | | | | | | | | | | | | available on darwin Change-Id: I961bb18604dd1568ea21431545f43aa6a417b3d9 GitHub-Last-Rev: 735f3364a4f2182f3e3e1b84f39a042e86987967 GitHub-Pull-Request: golang/go#60046 Reviewed-on: https://go-review.googlesource.com/c/go/+/493415 Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: Mateusz Poliwczak <mpoliwczak34@gmail.com> Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com>
* net: treat EAI_NODATA as errNoSuchHostMateusz Poliwczak2023-04-041-0/+1
| | | | | | | | | | | | | | | | | | | | man getaddrinfo: EAI_NODATA The specified network host exists, but does not have any network addresses defined. In the go resolver we treat this kind of error as nosuchhost. Change-Id: I69fab6f8da8e3a86907e65104bca9f055968633a GitHub-Last-Rev: b4891e2addaeccecb242d0485daa168bb55cf54e GitHub-Pull-Request: golang/go#57507 Reviewed-on: https://go-review.googlesource.com/c/go/+/459955 Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: Mateusz Poliwczak <mpoliwczak34@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org>
* internal/syscall/unix: use runtime.gostring for GostringIan Lance Taylor2022-11-111-10/+4
| | | | | | | | | | | | | | | | | Under the race detector, checkptr flags uses of unsafe.Slice that result in slices that straddle multiple Go allocations. Avoid that scenario by calling existing runtime code. This fixes a failure on the darwin-.*-race builders introduced in CL 446178. Change-Id: I6e0fdb37e3c3f38d97939a8799bb4d10f519c5b9 Reviewed-on: https://go-review.googlesource.com/c/go/+/449936 Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> Auto-Submit: Ian Lance Taylor <iant@golang.org>
* os/user: use libc (not cgo) on macOSRuss Cox2022-11-111-0/+6
| | | | | | | | | | | | | | | With net converted to libc, os/user is the last remaining cgo code in the standard libary on macOS. Convert it to libc too. Now only plugin remains as a cgo-using package on macOS. Change-Id: Ibb518b5c62ef9ec1e6ab6191f4b576f7c5a4501c Reviewed-on: https://go-review.googlesource.com/c/go/+/449316 Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
* net: unify CNAME handling across portsRuss Cox2022-11-081-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unix and Windows differ in how they handle LookupCNAME(name). If name exists in DNS with an A or AAAA record but no CNAME, then on all operating systems and in the pure Go resolver, LookupCNAME returns the name associated with the A/AAAA record (the original name). TestLookupCNAME has been testing this, because www.google.com has no CNAME. I think it did at one point, but not anymore, and the tests are still passing. Also added google.com as a test, since top-level domains are disallowed from having CNAMEs. If name exists in DNS with a CNAME record pointing to a record that does not exist or that has no A or AAAA record, then Windows has always reported the CNAME value, but Unix-based systems and the pure Go resolver have reported a failure instead. cname-to-txt.go4.org is an test record that is a CNAME to a non-A/AAAA target (the target only has a TXT record). This CL changes the Unix-based systems and the pure Go resolver to match the Windows behavior, allowing LookupCNAME to succeed whenever a CNAME exists. TestLookupCNAME nows tests the new behavior by looking up cname-to-txt.go4.org (run by bradfitz). Fixes #50101. Change-Id: Ieff5026c8535760e6313c7a41ebd5ff24de6d9be Reviewed-on: https://go-review.googlesource.com/c/go/+/446179 Run-TryBot: Russ Cox <rsc@golang.org> Auto-Submit: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
* net: use libc (not cgo) for DNS on macOSRuss Cox2022-11-011-0/+116
Change the macOS implementation to use libc calls. Using libc calls directly is what we do for all the runtime and os syscalls. Doing so here as well improves consistency and also makes it possible to cross-compile (from non-Mac systems) macOS binaries that use the native name resolver. Fixes #12524. Change-Id: I011f4fcc5c50fbb5396e494889765dcbb9342336 Reviewed-on: https://go-review.googlesource.com/c/go/+/446178 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>