36 Commits

Author SHA1 Message Date
Nick Figgins
3b31286d86 ipv4,ipv6: remove unneeded deadlines added for flaky tests
Deadlines were added in https://go.dev/cl/21360043, but these are
unneeded as the tests will fail anyways as a result of the timeout.
This prevents these timeouts from causing further test flakes.

Fixes #58955

Change-Id: I76ebf7452bf326a09f1a7665d362fe68f345a4be
GitHub-Last-Rev: 9ca732a5ea
GitHub-Pull-Request: golang/net#172
Reviewed-on: https://go-review.googlesource.com/c/net/+/492620
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: WANG Xuerui <git@xen0n.name>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2023-05-16 21:31:51 +00:00
Tobias Klauser
0bfab66a03 ipv4, ipv6: drop redundant skip checks based on GOOS
All the dropped platforms either don't support raw sockets or the tests
pass sucessfully (e.g. ipv4.TestPacketConnReadWriteMulticastICMP on
solaris), so the tests can rely on being skipped due to
!nettest.SupportsRawSocket().

Also check for errNotImplemented to cover cases where functionality is
not available on windows.

Change-Id: Ic9107a7ca16e9d9faed4991e1148b493c646ea7d
Reviewed-on: https://go-review.googlesource.com/c/net/+/489155
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
2023-04-28 20:20:13 +00:00
Tobias Klauser
938ff153cf ipv4, ipv6, nettest: skip unsupported tests on wasip1
Updates golang/go#58141

Change-Id: Iec7a525633dcc93c8941c9aaaef6e54e6867a8d0
Reviewed-on: https://go-review.googlesource.com/c/net/+/485675
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-04-19 19:08:58 +00:00
Cuong Manh Le
2aa82152a5 nettest: use RoutedInterface for probing network stack capability
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.

Fixes golang/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>
2022-12-23 17:16:06 +00:00
Tobias Klauser
c7608f3a84 ipv4, ipv6: enable additional tests on darwin and ios
These tests seem to work on all supported macOS and iOS versions, so
enable them on darwin and ios.

Change-Id: I95a221e4a7bc925bf1f83b763711f8f9fea03daf
Reviewed-on: https://go-review.googlesource.com/c/net/+/419938
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-07-28 21:13:54 +00:00
Bryan C. Mills
1185a90181 ipv4,ipv6: retry ENOBUFS in TestPacketConnReadWriteUnicastUDP
This ports CL 402059 to the non-concurrent UDP and ICMP variants of
the test.

(It isn't obvious to me whether the ENOBUFS retry loop is strictly
needed for the ICMP variants, but I'm getting kind of tired of porting
this CL to different tests and would rather minimize the number of
times it has to be done again. 😩)

Fixes golang/go#53402.

Change-Id: I8dc385fbce121c364efafd988ccf08eebe3fef28
Reviewed-on: https://go-review.googlesource.com/c/net/+/416556
Auto-Submit: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-07-08 22:07:12 +00:00
billofarrell
146b70c837 all: add support for zos/s390x
This adds net support for zos/s390x. These changes should not affect other platforms.

Fixes golang/go#42130

Change-Id: Ia7faa29de76b7c5713120657b296106c2e27bfd2
Reviewed-on: https://go-review.googlesource.com/c/net/+/264028
Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Trust: Emmanuel Odeke <emmanuel@orijtech.com>
2020-10-26 09:15:29 +00:00
Cherry Zhang
328152dc79 all: add GOOS=ios
Following CL 254740, this CL does it on x/net.

Updates golang/go#38485.

Change-Id: I80831dd0faa6f216d8d3b8f1af0af811aacce43f
Reviewed-on: https://go-review.googlesource.com/c/net/+/255537
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2020-09-23 18:22:12 +00:00
Tobias Klauser
3b0461eec8 internal/socket, ipv4, ipv6: add support for GOOS=illumos
Treat it like GOOS=solaris for now.

Change-Id: I2b99427e80058f6c7308fe3752de21610457a3ba
Reviewed-on: https://go-review.googlesource.com/c/net/+/183277
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2019-06-20 20:02:07 +00:00
chigotc
8dbb310b6f ipv6: add port for aix/ppc64
Change-Id: If8e693cc14109f928bc263f8c5744d7ba5a441ab
Reviewed-on: https://go-review.googlesource.com/c/net/+/170559
Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Mikio Hara <mikioh.public.networking@gmail.com>
2019-04-19 01:02:38 +00:00
Mikio Hara
63eda1eb06 all: use of nettest, remove internal/nettest
This change uses the nettest package where possible and removes the
internal/nettest package.

Change-Id: I5615a3ab7957183fecea6b5646df99dbb7c186e2
Reviewed-on: https://go-review.googlesource.com/c/net/+/123057
Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2019-03-27 21:43:58 +00:00
Mikio Hara
9f648a60d9 ipv6: skip tests on aix, fuchsia and hurd
Also marks test helper functions.

Change-Id: I1baf791b6d4199699db20834fa6e1a3bd0733cf0
Reviewed-on: https://go-review.googlesource.com/c/net/+/167340
Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2019-03-13 22:02:15 +00:00
Mikio Hara
4cb1c02c05 ipv6: don't fail test on JS
Change-Id: I9dd88938ddf23a80bf7ac40292dc55954f51f275
Reviewed-on: https://go-review.googlesource.com/121557
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-06-29 03:53:31 +00:00
Mikio Hara
570fa1c913 ipv6: simplify tests and benchmarks
Change-Id: I248e5e5215960bceaba357d3d4a6e72191f955b1
Reviewed-on: https://go-review.googlesource.com/47372
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2017-07-04 09:14:38 +00:00
Dmitri Shuralyov
5d997795f7 all: make copyright headers consistent with one space after period
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>
2016-11-07 23:52:11 +00:00
Mikio Hara
a7769702ac ipv6: add support for solaris
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.

Fixes golang/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>
2016-10-06 03:49:20 +00:00
Mikio Hara
d5cd7348bf ipv6: simplify log message format
This change replaces the existing log format separated by commas and
spaces with space-separated one.

Also removes unnecessary log output in test.

Change-Id: I7fc5da1b58734a7ee1d06da4e15408bef0162b0b
Reviewed-on: https://go-review.googlesource.com/16323
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-12-03 09:14:02 +00:00
Mikio Hara
9dd48c277b ipv6: remove unnecessary double quotations from test messages
Change-Id: I1d91ddf7fb4eebd4782f0621446ec2820d132788
Reviewed-on: https://go-review.googlesource.com/3562
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-01-30 07:59:18 +00:00
Mikio Hara
1439fec228 ipv6: make use of nettest.SupportsRawIPSocket
Change-Id: I3cf716c9ae02d7daa0d5a11249c3b58f6c8be2fe
Reviewed-on: https://go-review.googlesource.com/3403
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-01-29 21:55:09 +00:00
Mikio Hara
668aea8e02 x/net/ipv6: split Set method of ICMPFilter into Accept, Block methods
This is an API breaking change.

method (*ICMPFilter) Set(ICMPType, bool)

is now replaced with

method (*ICMPFilter) Accept(ICMPType)
method (*ICMPFilter) Block(ICMPType)

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/182450043
2014-12-04 17:32:07 +09:00
Mikio Hara
597bbe1988 x/net/ipv6: use new import path for icmp
LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/183040043
2014-12-03 12:33:31 +09:00
Mikio Hara
b56b609928 x/net/ipv6: fix full stack test cases
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
2014-11-16 11:31:00 +09:00
Mikio Hara
586296a63e x/net/ipv6: skip ancillary data socket option tests on non-supported kernels
For old darwin kernels.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/166410043
2014-11-11 06:58:12 +09:00
Mikio Hara
b1772d9247 x/net/ipv6: disable full stack tests on nacl
LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/172900043
2014-11-10 09:47:55 +09:00
Andrew Gerrand
fbe893ddcd go.net: use golang.org/x/... import paths
LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/167030043
2014-11-10 09:04:43 +11:00
Mikio Hara
77ebfc57e4 go.net/ipv6: make use of internal/{iana,icmp,nettest} packages
LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/168210043
2014-11-09 20:14:20 +09:00
Mikio Hara
3a0acf563f go.net/ipv6: don't set non-working parameters in test
LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/172720043
2014-11-06 10:49:49 +09:00
Mikio Hara
9704df9680 go.net/ipv6: add support for dragonfly
Update golang/go#7174

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/91770049
2014-04-27 22:30:08 +09:00
Mikio Hara
0cda728e61 go.net/ipv6: fix build on dragonfly, plan9, solaris
R=golang-codereviews, aram, r, 0intro
CC=golang-codereviews
https://golang.org/cl/54350043
2014-01-23 06:36:22 +01:00
Mikio Hara
16ae462212 go.net/ipv6: better readability in test
R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/46740043
2014-01-01 18:06:29 +09:00
Mikio Hara
1a76020cd9 go.net/ipv6: add missing API tests
Now the package has a code coverage of 76.1% of statements.
Also fixes flaky concurrent test.

Fixes golang/go#5696.

R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/45620043
2013-12-31 23:24:59 +09:00
Mikio Hara
998fc9edb8 go.net/ipv6: add missing API tests
Now the package has a code coverage of 74.5% of statements.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/21080043
2013-11-02 16:50:34 +09:00
Mikio Hara
da09de3034 go.net/ipv6: add ICMP checksum test
This CL enables testing raw ICMP packets with and without a setting of
ICMP checksum field.

Actually it's just for Linux because almost all BSD variants never
allow us to touch the checksum field of ICMP but Linux does when we use
the value 255 for the socket level.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/15020047
2013-11-02 16:48:13 +09:00
Mikio Hara
efd3170216 go.net/ipv6: do not measure preparation time in datagram benchmark
Update golang/go#5538

R=dave
CC=golang-dev
https://golang.org/cl/10044047
2013-06-15 13:18:49 +09:00
Mikio Hara
a46af89e38 go.net/ipv6: disable tests on non-ipv6 kernels
R=dave, capnm9
CC=golang-dev
https://golang.org/cl/10051046
2013-06-06 17:12:18 +09:00
Mikio Hara
cdfc4ce106 go.net/ipv6: new package
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.

Fixes golang/go#5538.

R=dave
CC=golang-dev
https://golang.org/cl/9843044
2013-06-04 17:42:58 +09:00