From: Ian Lance Taylor Date: Wed, 3 Jan 2018 20:59:09 +0000 (-0800) Subject: net: set CLOEXEC on sockets used for capability probes X-Git-Tag: go1.10beta2~64 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=f05c8b48ea2d249965418e76c9151a3d6bde7ed9;p=gostls13.git net: set CLOEXEC on sockets used for capability probes Fixes #22349 Change-Id: I84ec4fa9fa95bac0f26bf4ca3e62a35dff4f7e00 Reviewed-on: https://go-review.googlesource.com/86015 Run-TryBot: Ian Lance Taylor Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- diff --git a/src/net/ipsock_posix.go b/src/net/ipsock_posix.go index d659bf063a..8372aaa742 100644 --- a/src/net/ipsock_posix.go +++ b/src/net/ipsock_posix.go @@ -24,7 +24,7 @@ import ( // general. Unfortunately, we need to run on kernels built without // IPv6 support too. So probe the kernel to figure it out. func (p *ipStackCapabilities) probe() { - s, err := socketFunc(syscall.AF_INET, syscall.SOCK_STREAM, syscall.IPPROTO_TCP) + s, err := sysSocket(syscall.AF_INET, syscall.SOCK_STREAM, syscall.IPPROTO_TCP) switch err { case syscall.EAFNOSUPPORT, syscall.EPROTONOSUPPORT: case nil: @@ -48,7 +48,7 @@ func (p *ipStackCapabilities) probe() { probes = probes[:1] } for i := range probes { - s, err := socketFunc(syscall.AF_INET6, syscall.SOCK_STREAM, syscall.IPPROTO_TCP) + s, err := sysSocket(syscall.AF_INET6, syscall.SOCK_STREAM, syscall.IPPROTO_TCP) if err != nil { continue }