Commit Graph

185 Commits

Author SHA1 Message Date
Damien Neil
c1f5833288 all: replace deprecated io/ioutil calls
The io/ioutil package's features were moved to
the io and os packages in Go 1.16.

x/net depends on Go 1.18. Drop ioutil calls,
so gopls doesn't warn about them.

Change-Id: Ibdb576d94f250808ae285aa142e2fd41e7e9afc9
Reviewed-on: https://go-review.googlesource.com/c/net/+/586244
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-05-21 19:59:00 +00:00
Dmitri Shuralyov
d23d9bc549 all: update go directive to 1.18
Done with:

go get go@1.18
go mod tidy
go fix ./...

Using go1.21.3.

With a manual change to keep golang.org/x/net/context testing itself,
not context in the standard library.

For golang/go#60268.

Change-Id: I00682bf7cf1e3ba4370e2a3e7f63dc245b294a36
Reviewed-on: https://go-review.googlesource.com/c/net/+/534241
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
2023-10-11 21:58:12 +00:00
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
Oleksandr Redko
7e3c19ca52 all: correct typos in comments
Change-Id: Idc75240e5546be2f2b091878910339b4967c93c7
GitHub-Last-Rev: c78560c06f
GitHub-Pull-Request: golang/net#166
Reviewed-on: https://go-review.googlesource.com/c/net/+/465715
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-02-07 17:08:46 +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
Meng Zhuo
f428fae207 all: add FreeBSD riscv64 support
For golang/go#53466

Change-Id: Ibbeab43923bdd6b455a28c627832e676b401b4f4
Reviewed-on: https://go-review.googlesource.com/c/net/+/418814
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Goutnik <dgoutnik@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Meng Zhuo <mzh@golangcn.org>
2022-08-09 01:22:01 +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
Bryan C. Mills
2871e0cb64 ipv4,ipv6: retry ENOBUFS and shut down the PacketConn on failure in TestPacketConnConcurrentReadWriteUnicastUDP
This ports CL 376094 and CL 376095 to the UDP variants of the test.

Fixes golang/go#52549 (hopefully).

Change-Id: I2537af1bc14a42b2e51882e5d646912e1239758c
Reviewed-on: https://go-review.googlesource.com/c/net/+/402059
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-04-25 22:30:48 +00:00
Russ Cox
290c469a71 all: gofmt
Gofmt to update doc comments to the new formatting.

For golang/go#51082.

Change-Id: Iae68a9cd600060577271575e893ecb23bed1e509
Reviewed-on: https://go-review.googlesource.com/c/net/+/399599
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-04-12 02:06:05 +00:00
Guoqi Chen
d55c255bac ipv4, ipv6, internal/socket: add loong64 support
Change-Id: I5419445ef15b0c080fb3b5c2bd413d74ac52bdd4
Co-authored-by: limeidan <limeidan@loongson.cn>
Co-authored-by: liuxiaodong <liuxiaodong@loongson.cn>
Reviewed-on: https://go-review.googlesource.com/c/net/+/355549
Trust: Damien Neil <dneil@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-01-11 09:31:09 +00:00
Bryan C. Mills
5cfca573fb ipv6: retry ENOBUFS errors in TestPacketConnConcurrentReadWriteUnicast
This change is sheer speculation based on the failures observed in
golang/go#37319.

(A deadlock in the test prevented us from seeing the actual failure
mode of golang/go#50455 up until CL 376094, and it isn't obvious to me
that we should wait for another failure before trying a likely — and
otherwise harmless — fix.)

Fixes golang/go#50455.
(Maybe.)

Change-Id: I7483eb2243832d07cb1f815da196b3978a50c6b3
Reviewed-on: https://go-review.googlesource.com/c/net/+/376095
Trust: 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@golang.org>
2022-01-07 19:22:37 +00:00
Bryan C. Mills
8b8fc0806a ipv6: shut down the PacketConn on failure in TestPacketConnConcurrentReadWriteUnicast
This avoids a deadlock (observed in golang/go#50455) that may
otherwise swallow the error logs from a failure, which may help us
better diagnose the underlying problem.

For golang/go#50455.

Change-Id: Id73bd9589ae23385a433da0b24840ef945601f63
Reviewed-on: https://go-review.googlesource.com/c/net/+/376094
Trust: 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@golang.org>
2022-01-07 19:22:09 +00:00
Bryan C. Mills
eba003a116 ipv6: in PacketConn tests, retry writes that fail with ENOBUFS
In golang/go#37319, TestPacketConnReadWriteMulticastUDP was observed
to occasionally fail with ENOBUFS on macOS.

This change adds a retry loop for that test function. There are some
other related test functions that may also wrap sendmsg, but I have
not observed any ENOBUFS failures for them — I suspect that some
difference in protocol or traffic class prevents this failure mode,
but we can always add more retry loops if we discover that they are
actually needed.

Fixes golang/go#37319.

Change-Id: I99fce94ff10c6f3c09d493712eba782ec8707a58
Reviewed-on: https://go-review.googlesource.com/c/net/+/369742
Trust: 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@golang.org>
2021-12-06 22:34:03 +00:00
Bryan C. Mills
266e24b1e4 ipv6: remove arbitrary deadlines from tests
These deadlines were added back in CL 21080043, apparently in an
attempt to increase code coverage numbers. However, nothing in the
tests actually exercises the deadline logic: the tests would pass even
if these methods were no-ops. Their only apparent effect is to make
the tests flaky on slower builders, and to destroy goroutine traces
if the test should ever happen to deadlock.

Updates golang/go#42064
For golang/go#37319

Change-Id: I530a8f3cb80d6d93d1625bc88f0ec7958d4ec35e
Reviewed-on: https://go-review.googlesource.com/c/net/+/366181
Trust: 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@golang.org>
2021-12-06 22:32:45 +00:00
Ian Lance Taylor
fe8b969b2d ipv6: OpenBSD does not appear to support multicast loopback
Skip the tests for it, as we already skip them on FreeBSD.

Fixes golang/go#42064

Change-Id: I058f25309020367e686625033b4f25cb614c7f99
Reviewed-on: https://go-review.googlesource.com/c/net/+/366355
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2021-11-23 20:29:08 +00:00
Tobias Klauser
798c2154c5 ipv6: use all socket option consts from x/sys/unix
Remove the remaining local definitions of various socket option
constants and use the constants defined in the golang.org/x/sys/unix
package instead.

Change-Id: I110cf984e2bac5bf48d6e6489fd6da8ab7b13b10
Reviewed-on: https://go-review.googlesource.com/c/net/+/311749
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-04-20 21:01:06 +00:00
Tobias Klauser
0fccb6fa2b ipv6: use socket option consts from x/sys/unix on netbsd, openbsd and dragonfly
Use the socket option constants defined in the golang.org/x/sys/unix
package instead of duplicating them in this package.

Note that for now, sysIPV6_TCLASS, sysIPV6_PATHMTU, sysIPV6_PKTINFO,
sysIPV6_HOPLIMIT and sysIPV6_NEXTHOP still need to be defined because
they are used in code shared with other platforms.

Change-Id: I40896c6c191aade35e3f9f1fb1a624f772e7479a
Reviewed-on: https://go-review.googlesource.com/c/net/+/306071
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2021-03-31 21:22:08 +00:00
Tobias Klauser
cb1fcc7394 ipv6: use socket option consts from x/sys/unix on freebsd
Use the socket option constants defined in the golang.org/x/sys/unix
package instead of duplicating them in this package.

Note that for now, sysIPV6_TCLASS, sysIPV6_PATHMTU, sysIPV6_PKTINFO,
sysIPV6_HOPLIMIT and sysIPV6_NEXTHOP still need to be defined because
they are used in code shared with other platforms.

Change-Id: I5de2fa26dea61b0de94cbe48575c1d842c973ff5
Reviewed-on: https://go-review.googlesource.com/c/net/+/306070
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
2021-03-31 06:09:03 +00:00
Tobias Klauser
22f4162a90 ipv6: use socket option consts from x/sys/unix on aix
Use the socket option constants defined in the golang.org/x/sys/unix
package instead of duplicating them in this package.

Note that for now, sysIPV6_TCLASS, sysIPV6_PATHMTU, sysIPV6_PKTINFO,
sysIPV6_HOPLIMIT and sysIPV6_NEXTHOP still need to be defined because
they are used in code shared with other platforms.

Change-Id: Ide4f882ca57661bba0fb88de55375ee36a412deb
Reviewed-on: https://go-review.googlesource.com/c/net/+/305589
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-03-30 07:57:24 +00:00
Tobias Klauser
df645c7b52 ipv6: enable IPV6_PATHMTU and IPV6_TCLASS tests on darwin/ios
These options are supported on all darwin/ios versions currently
supported by Go.

Change-Id: I4cf1f435889cbbfbfb12321114e3c2e18bb613b2
Reviewed-on: https://go-review.googlesource.com/c/net/+/305350
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-03-29 18:18:59 +00:00
Tobias Klauser
db2394d137 ipv6: use socket option consts from x/sys/unix on darwin
Use the socket option constants defined in the golang.org/x/sys/unix
package instead of duplicating them in this package.

Note that for now, sysIPV6_TCLASS, sysIPV6_PATHMTU, sysIPV6_PKTINFO,
sysIPV6_HOPLIMIT and sysIPV6_NEXTHOP still need to be defined because
they are used in code shared with other platforms.

Change-Id: I03b539ef23899b395fa9bc082f28e0299e47c9c8
Reviewed-on: https://go-review.googlesource.com/c/net/+/305349
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-03-29 18:18:48 +00:00
Tobias Klauser
53308faee3 ipv6: use socket option consts from x/sys/unix on linux
Use the socket option constants defined in the golang.org/x/sys/unix
package instead of duplicating them in this package.

Note that for now, sysIPV6_TCLASS, sysIPV6_PATHMTU, sysIPV6_PKTINFO,
sysIPV6_HOPLIMIT and sysIPV6_NEXTHOP still need to be defined because
they are used in code shared with other platforms.

Change-Id: Iba40f51959c4c0e61557322d00c4621b783cd8c0
Reviewed-on: https://go-review.googlesource.com/c/net/+/305389
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-03-29 18:18:31 +00:00
Tobias Klauser
d523dce5a7 ipv4, ipv6: use IP_* socket option constants from x/sys/windows
Use the IP_* socket option constants defined in the
golang.org/x/sys/windows package instead of defining them locally.

Change-Id: Ie6e79b7984795c409a01bd57134090bb720ea4b3
Reviewed-on: https://go-review.googlesource.com/c/net/+/301810
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-03-16 09:26:52 +00:00
Russ Cox
5f55cee0dc all: go fmt ./...
Make all our package sources use Go 1.17 gofmt format
(adding //go:build lines).

Not strictly necessary but will avoid spurious changes
as files are edited.

Part of //go:build change (#41184).
See https://golang.org/design/draft-gobuild

Change-Id: I5b2b7d93424e828a3c5f76ae3f30ab825aca388e
Reviewed-on: https://go-review.googlesource.com/c/net/+/294371
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-02-20 03:31:24 +00:00
Tobias Klauser
5f4716e947 ipv6: skip known-failing tests on openbsd-{arm,arm64,mips64}-jsing builders
The arm64 and mips64 builder run OpenBSD 6.8:

openbsd-arm64-jsing:
OpenBSD gopher-arm64.sing.id.au 6.8 GENERIC.MP#2 arm64

openbsd-mips64-jsing:
OS: OpenBSD er4.sing.id.au 6.8 GENERIC.MP#0 octeon

The openbsd-arm-jsing builder was offline but according to
https://github.com/golang/go/issues/25498#issuecomment-636295933
it's running at least OpenBSD 6.7. Assuming that this version is
affected as well (or the builder was upgraded to 6.8 in the meantime),
skip TestPacketConnReadWriteMulticastUDP on this builder as well.

For golang/go#11811.
Updates golang/go#42064.

Change-Id: Ia9919057bfc2a69b8884228508ae919ce9d624e9
Reviewed-on: https://go-review.googlesource.com/c/net/+/283752
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Joel Sing <joel@sing.id.au>
2021-01-19 19:43:25 +00:00
Dmitri Shuralyov
6772e930b6 ipv6: skip known-failing tests on OpenBSD 6.8 builders
These tests are known to be failing on OpenBSD 6.8 and need
investigation. The OpenBSD 6.8 builders are default TryBots
now, so skip them to prevent people working on other packages
from constantly getting a failure.

Issue 42064 remains open to do the work of determining if the
ipv6 package needs to be fixed, or if OpenBSD 6.8 has a problem
and the test can be permanently skipped as unsupported.

For golang/go#11811.
Updates golang/go#42064.
Updates golang/go#35712.

Change-Id: I59883384e4dbce679cb1a4e8e2c3f0fa7983010b
Reviewed-on: https://go-review.googlesource.com/c/net/+/280052
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
2020-12-24 01:40:10 +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
f229aea8fa ipv4, ipv6: remove or move unused err* vars
errNoSuchInterface is only used in ipv4/sys_asmreq.go which is not built
e.g. on Linux, so move it there.

Change-Id: I18b2e2ec8f321db3df164dcc6a69b8c92e6ab68c
Reviewed-on: https://go-review.googlesource.com/c/net/+/220097
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2020-02-19 18:36:38 +00:00
Tobias Klauser
fc4aabc6c9 ipv4, ipv6: use SockFprog definitions from x/sys/unix
This fixes the mips{,64}{,le} builders failing the bpf-related
tests and also avoids duplicating these consts/types across packages.

Fixes golang/go#35669

Change-Id: I1ea96817464e3040e8cc00bff63c168fa5e75a71
Reviewed-on: https://go-review.googlesource.com/c/net/+/207286
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-11-19 07:31:36 +00:00
Dmitri Goutnik
83d349e8ac ipv4, ipv6: add support for freebsd/arm64
Updates golang/go#35183

Change-Id: I3d820a1638526197ca7b5e622f6f6f1317141f7b
Reviewed-on: https://go-review.googlesource.com/c/net/+/203518
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2019-10-27 09:30:00 +00:00
Tobias Klauser
ec77196f60 ipv6: re-enable tests on Dragonfly
Now that golang.org/x/net was re-vendored into std, these tests should
pass again.

Updates golang/go#34368

Change-Id: I6f253896836fb18d46875a9420de58ca05a49646
Reviewed-on: https://go-review.googlesource.com/c/net/+/202457
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-10-21 14:45:47 +00:00
Tobias Klauser
24d2ffbea1 all: fix tests on dragonfly after ABI changes
Detect the ABI version based on kern.osreldate.

Only use 32-bit cmsg alignment for versions before the September 2019
ABI changes:
http://lists.dragonflybsd.org/pipermail/users/2019-September/358280.html

Use RTM_VERSION 7 on Dragonfly master (5.8 release).

Determine sizeof struct ifa_msghdr at runtime based on the ABI version.

Temporarily skip some test relying on the net package which will only be
fixed once this CL is re-vendored into std.

Updates golang/go#34368

Change-Id: I732fab21d569b303f45dfb6a0bbbb11469511a07
Reviewed-on: https://go-review.googlesource.com/c/net/+/202317
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-10-21 12:47:07 +00:00
Antonio Huete Jimenez
c5a3c61f89 all: adjust defs for Dragonfly BSD
- DragonFly BSD removed RTM_OLDADD and RTM_OLDDEL
  constants on Aug 4th, 2017 and are now gone in both master
  branch and RELEASE 5.6. It also removed IPV6_IPSEC_POLICY
  constant since IPSEC was removed from base and kernel.

Change-Id: I99fbdfcb95fb276374f7b2dbd5fa30fe3f30f709
GitHub-Last-Rev: 1f27a0e26e
GitHub-Pull-Request: golang/net#54
Reviewed-on: https://go-review.googlesource.com/c/net/+/197599
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Run-TryBot: Benny Siegert <bsiegert@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-09-30 13:41:27 +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
Tobias Klauser
d28f0bde59 all: follow convention for generated code comment
Follow the convertion (https://golang.org/s/generatedcode) for generated
code.

Change-Id: I3101fb91db42644ead179ffaeffe0211359ac886
Reviewed-on: https://go-review.googlesource.com/c/net/+/182137
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-06-13 19:41:53 +00:00
CarlosEDP
018c4d40a1 ipv4, ipv6, internal/socket: add riscv64 support
Updates golang/go#27532

Change-Id: I64285280680e5d1d3903c352454f2c67cc653c88
GitHub-Last-Rev: 3747f61487
GitHub-Pull-Request: golang/net#43
Reviewed-on: https://go-review.googlesource.com/c/net/+/177997
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2019-05-20 21:01: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
1d742bf2a5 ipv6: replace errOpNoSupport with errNotImplemented
Change-Id: I1d5c364421a6ba30c43f88ef4f333c7ea02a3bd4
Reviewed-on: https://go-review.googlesource.com/c/net/+/167338
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 21:54:59 +00:00
Mikio Hara
c10a0554ea ipv6: drop support for go1.8 or below
Change-Id: I9f4108283333eb56aad429bb6338231459bc2bbf
Reviewed-on: https://go-review.googlesource.com/c/net/+/162599
Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
2019-03-10 07:45:41 +00:00
Mikio Hara
617fbc828a ipv6: rename freebsd32o64 with compatFreeBSD32 for consistency
The variable name compatFreeBSD32 refers to the kernel configuration
directive COMPAT_FREEBSD32 and is also used in route and ipv6 packages.

Change-Id: I00e6de390c25b7df45b76e772719a83fa6b0843b
Reviewed-on: https://go-review.googlesource.com/c/149879
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-02-27 02:21:22 +00:00
Mikio Hara
d76a190299 ipv6: make not implemented errors more descriptive
Change-Id: I4710227d104330fa28a563530bd93a3ae8a6c070
Reviewed-on: https://go-review.googlesource.com/c/149877
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-02-27 02:20:43 +00:00
Tobias Klauser
be88a9aa50 ipv4, ipv6: directly initialize ctlOpts and sockOpts
After CL 156597 it's no longer necessary to initialize the ctlOpts and
sockOpts tables in the init func. Instead, just directly initialize them.

Change-Id: I62b4dd980b3cb87e3cbc71ea4874f6512b5cfefa
Reviewed-on: https://go-review.googlesource.com/c/156797
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-08 15:08:41 +00:00
Tobias Klauser
45ffb0cd1b ipv4, ipv6: drop support for macOS 10.7 and earlier
Drop the check for macOS 10.7 and earlier. Go 1.11 requires at least
macOS 10.10 and macOS 10.7 is no longer supported by Apple anyhow.

Change-Id: Ie7d9d27e0b9156ea478bf560734f4a85dfa163d6
Reviewed-on: https://go-review.googlesource.com/c/156597
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-01-07 21:02:23 +00:00
Mikio Hara
10aee18199 icmp, ipv4, ipv6: re-adjust build constraints
Also updates package documentation for AIX.

Change-Id: I4809a334f0a4b8f3fb5345749477394b8f3e7546
Reviewed-on: https://go-review.googlesource.com/c/147678
Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-11-06 06:57:22 +00:00