The ipv4/ipv6 support capability is done by explicitly listening on
loopback interface. However, it can lead to false positive, especially
for ipv6 case. For example, ipv6 can be enabled, but explicitly disable
for loopback interface (for security, policy ...).
This CL changes probeStack to use another approach, by looking for any
interface that can route IP traffic and in "UP" state. If there's one,
then the platform can do ipv4/ipv6 networking functionality.
Fixesgolang/go#57386
Change-Id: If911bc223b52c5a4562d3f61b4ee1032bdbec47c
Reviewed-on: https://go-review.googlesource.com/c/net/+/458096
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
TestConnUnicastSocketOptions doesn't work on nacl, plan9, or windows,
but the t.Skip at the top was missing the GOOS == "windows" check. (It
was present in the ipv6 version of the test)
The test than proceeded to try to run and set up a connection pair
for testing. Here's what was happening.
Goroutines are M (main, the client) and S (server, doing the Accept):
M: net.Listen("tcp4", "127.0.0.1:0"), succeeds.
M: defer ln.Close() enqueued.
M: go acceptor() (start "S" (server) goroutine)
M: net.Dial("tcp4", ln.Addr().String()), succeeds.
Notably, it's connected to the kernel's TCP stack at this point.
The userspace Accept hasn't run. Go's listen backlog is
syscall.SOMAXCONN on Windows (which is fine).
M: testUnicastSocketOptions:
- finds that it's GOOS == "windows",
- calls t.Skipf, which calls runtime.Goexit, runs deferred goroutines
M: ln.Close() (previously deferred runs)
M: test completes
Then:
S: server goroutine finally schedules
S: c, err := ln.Accept(), gets an error (because it's closed)
if err != nil {
t.Error(err) // setting an error after test is done; bogus
So, fix it both ways: skip the test earlier on "windows", and simplify
the server goroutine and move the failing into the main goroutine.
Also skip other tests earlier on Windows that will also t.Skip. They
don't have goroutines, but might as well skip earlier.
Fixesgolang/go#17655
Change-Id: I5d910d70943be37b2b4b56542ee98e42fc3acd71
Reviewed-on: https://go-review.googlesource.com/34021
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Go policy has been single space after periods in comments for some time.
The copyright header template at:
https://golang.org/doc/contribute.html#copyright
also uses a single space.
Make them all consistent.
This CL was generated with:
perl -i -npe 's,^(// Copyright [0-9]+ The Go Authors\.) (All rights reserved\.)$,$1 $2,' $(git grep -l -E '^// Copyright [0-9]+ The Go Authors\. All rights reserved\.$')
Follows https://golang.org/cl/20111.
Change-Id: I66671dddf821f5dc027bc254e0196b3e3a2bdf3b
Reviewed-on: https://go-review.googlesource.com/32878
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This change adds support for Solaris.
To read and write IPv6 ancillary data using ControlMessage, ipv6 pacakge
requires https://go-review.googlesource.com/30171/
Note: Unlike other platforms, Solaris seems to have a few restrictions
on ICMP property access via raw IP sockets. At least applications are
prohibited from using IPV6_CHECKSUM option for ICMP transport.
Fixesgolang/go#17324.
Change-Id: Ie014665d94ae6e4955c95d3eea88db90332e20bd
Reviewed-on: https://go-review.googlesource.com/30176
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Readjusts Traffic Class and ICMP test cases on older darwin kernels,
per-interface link-local address multicasting and loopback interface
required test cases on BSD variants.
Also simplifies error logs.
LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/177790043
Package ipv6 implements IP-level socket options for the Internet
Protocol version 6. It also provides datagram based network I/O
methods specific to the IPv6 and higher layer protocols.
Fixesgolang/go#5538.
R=dave
CC=golang-dev
https://golang.org/cl/9843044