192 Commits

Author SHA1 Message Date
Tobias Klauser
57ea86db08 icmp, internal/socket, ipv4, ipv6: use binary.NativeEndian
Instead of duplicating it as internal/socket.NativeEndian.

Change-Id: I7c7d76cc561b0f3083e8f33db7b90e2f421c12d5
Reviewed-on: https://go-review.googlesource.com/c/net/+/739840
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2026-01-29 07:04:13 -08:00
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
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
Bryan C. Mills
3bcbab3f74 ipv4: 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#51342 up until CL 387915, and it isn't obvious to me
that we should wait for another failure before trying a likely — and
otherwise harmless — fix.)

This is a port of CL 376095 to the "ipv4" package.

Fixes golang/go#51342.
(Maybe.)

Change-Id: Idd6d2d785dbb0c98404f99bd98a3c4ddc11cb2cf
Reviewed-on: https://go-review.googlesource.com/c/net/+/387916
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-02-25 14:31:45 +00:00
Bryan C. Mills
f80d34dcf0 ipv4: shut down the PacketConn on failure in TestPacketConnConcurrentReadWriteUnicast
This avoids a deadlock (observed in golang/go#51342) that may
otherwise swallow the error logs from a failure, which may help us
better diagnose the underlying problem.

This is a port of CL 376094 to the "ipv4" package.

For golang/go#51342

Change-Id: I7b5ba25fcbdd1ec0b319fe35b558d9dcbf8054c6
Reviewed-on: https://go-review.googlesource.com/c/net/+/387915
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-02-25 14:31:37 +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
Tobias Klauser
5f58ad60dd ipv4: use type IPMreqn from x/sys/unix
Use the IPMreqn type and the SizeofIPMreqn defined in the
golang.org/x/sys/unix package instead of locally duplicating them.

Change-Id: I98768e01fd4b0d1018892d5ed49455366a7356bb
Reviewed-on: https://go-review.googlesource.com/c/net/+/312490
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-23 18:45:38 +00:00
Tobias Klauser
d25e304258 ipv4: use all socket option consts from x/sys/unix
Remove the remaining local definitions of the IP_RECVDSTADDR, IP_RECVIF
and IP_RECVTTL socket option constants and use the constants defined in
the golang.org/x/sys/unix package instead.

Change-Id: I5308f5c5b3586e9d5c050e6cf126aeba48b47ba7
Reviewed-on: https://go-review.googlesource.com/c/net/+/311289
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 07:25:03 +00:00
Tobias Klauser
41e92686df ipv4: use socket option consts from x/sys/unix on 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, sysIP_RECVDSTADDR, sysIP_RECVIF and sysIP_RECVTTL
still need to be defined because they are used in code shared with other
platforms.

Change-Id: Icd77a4ab16019fec259030b26a8c7ee9ac8d3e6f
Reviewed-on: https://go-review.googlesource.com/c/net/+/304369
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-31 21:21:55 +00:00
Tobias Klauser
c8897c278d ipv4: use IP_PKTINFO const from x/sys/unix
Change-Id: I9b9bbebe0cfe36585709e9cbc7b8216d6427376a
Reviewed-on: https://go-review.googlesource.com/c/net/+/305590
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2021-03-30 14:28:15 +00:00
Tobias Klauser
61e056675e ipv4: use socket option consts from x/sys/unix on zos
Use the socket option constants defined in the golang.org/x/sys/unix
package instead of duplicating them in this package.

Change-Id: I737c5b391ec20cf6ffc791cd713c3653d38e75f5
Reviewed-on: https://go-review.googlesource.com/c/net/+/304713
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-26 22:08:55 +00:00
Tobias Klauser
6ef6e9bdcb ipv4: 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, sysIP_RECVDSTADDR, sysIP_RECVIF and sysIP_RECVTTL
still need to be defined because they are used in code shared with other
platforms.

Change-Id: I2b3b8621108c9399f1d36bab97c65fd349fa0839
Reviewed-on: https://go-review.googlesource.com/c/net/+/304712
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-26 22:08:43 +00:00
Tobias Klauser
6b15177628 ipv4: use socket option consts from x/sys/unix on solaris
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, sysIP_RECVDSTADDR, sysIP_RECVIF, sysIP_RECVTTL and
sysIP_PKTINFO still need to be defined because they are used in code
shared with other platforms.

Change-Id: I900ac4460d350d5d8959d34db339831657b7e03f
Reviewed-on: https://go-review.googlesource.com/c/net/+/304711
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-26 06:03:03 +00:00
Tobias Klauser
ef31e18dbd ipv4: use socket option consts from x/sys/unix on netbsd and openbsd
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, sysIP_RECVDSTADDR, sysIP_RECVIF and sysIP_RECVTTL
still need to be defined because they are used in code shared with other
platforms.

Change-Id: I6a6b39e94ec123889c08b55bc469ad51107399cb
Reviewed-on: https://go-review.googlesource.com/c/net/+/304710
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-26 06:02:29 +00:00
Tobias Klauser
f475aed52b ipv4: 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, sysIP_RECVDSTADDR, sysIP_RECVIF and sysIP_RECVTTL
still need to be defined because they are used in code shared with other
platforms.

Change-Id: Ic937ccbc0a554c8dd6e0b9f36b1601ba86f62f5f
Reviewed-on: https://go-review.googlesource.com/c/net/+/304709
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-26 06:01:27 +00:00
Tobias Klauser
d1beb07c20 ipv4: 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, sysIP_PKTINFO and sysIP_RECVTTL are still needed
because they are used in code shared with other platforms.

Change-Id: Iae627111837a3707fc9079d490d11e34ee3365cf
Reviewed-on: https://go-review.googlesource.com/c/net/+/304330
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-24 20:56:30 +00:00
Tobias Klauser
2c4c8ecb78 ipv4: 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, sysIP_RECVDSTADDR, sysIP_RECVIF, sysIP_RECVTTL and
sysIP_PKTINFO still need to be defined because they are used in code
shared with other platforms.

Change-Id: I9bb953dc72dea19e9e9d84dc641346fe95bad070
Reviewed-on: https://go-review.googlesource.com/c/net/+/303909
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-24 05:16:36 +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
Tobias Klauser
34ac3e1c20 ipv4: remove unused type inetPktinfo
This type is not used in this package on windows and it is no
corresponding C type defined in the Windows API C headers.

Change-Id: Ic581331d1f04599369361e26d8b38cf2e32241ab
Reviewed-on: https://go-review.googlesource.com/c/net/+/301809
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-15 17:06:53 +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
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
Tamir Duberstein
dbdefad45b ipv4: refactor multicast tests to use subtests
- Improve error discipline
- Narrow test types from net.UDPAddr to net.IPAddr where possible

Change-Id: I6c403ae69685ac3f35e427f56027fe4a29fde540
Reviewed-on: https://go-review.googlesource.com/c/net/+/260679
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
2020-10-09 03:24:41 +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
7e3656a080 ipv4: remove unused const maxHeaderLen
It's unused since CL 162598.

Change-Id: I434dbc9950bb535167c40498ed7c15589db74eaf
Reviewed-on: https://go-review.googlesource.com/c/net/+/232537
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2020-05-06 14:57:44 +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
Brad Fitzpatrick
fe3aa8a452 ipv4: use unsafe.Sizeof on struct size, not pointer size
Fix for CL 203400.

Change-Id: Ia0006cdeff4992a218c7a355bd83354138706833
Reviewed-on: https://go-review.googlesource.com/c/net/+/203777
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-10-28 08:55:09 +00:00
Cuong Manh Le
d64ee3fa51 ipv4: fix unsafe pointer conversion in parseInterface
Fixes golang/go#35174

Change-Id: I01ae0ec25c90da0d05b1b262b33a32233f88260f
Reviewed-on: https://go-review.googlesource.com/c/net/+/203400
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-10-27 21:20:02 +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
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
Mikio Hara
afa5a82059 ipv4: clarify the range of broken freebsd kernel versions
Change-Id: Ic37732f28e747c98cb513e100983d685efd3928d
Reviewed-on: https://go-review.googlesource.com/c/net/+/173077
Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-04-20 06:30:19 +00:00
chigotc
c98bf442cc ipv4: add port for aix/ppc64
Change-Id: Ida9aed579c9a33883dadfef094c30a658edce88e
Reviewed-on: https://go-review.googlesource.com/c/net/+/170558
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:24 +00:00
Yuval Pavel Zholkover
4a65cf94b6 ipv4: work around FreeBSD 12.0 kernel running COMPAT_FREEBSD32
Followup for CL 168297, a fix was released for the kernel bug https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236737

https://svnweb.freebsd.org/base?view=revision&revision=345741
https://svnweb.freebsd.org/base?view=revision&revision=346019
https://svnweb.freebsd.org/base?view=revision&revision=346020

Thus the bug won't affect 11.3-RELEASE and 12.1-RELEASE when they are out.

Update adjustFreeBSD32 to handle only FreeBSD 12.0-RELEASE ranges of freebsdVersion.

Updates golang/go#30899

Change-Id: I6beeaa55023dbe86a3d6fd8d6d5094516ec6978a
Reviewed-on: https://go-review.googlesource.com/c/net/+/171937
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-04-15 10:05:56 +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
1272bf9dcd ipv4: work around FreeBSD 11.3 or 12 kernel running COMPAT_FREEBSD32
On FreeBSD 11.3 or 12 kernel running COMPAT_FREEBSD32, it looks like the
system call recvmsg always returns an incorrect length for the
out-of-band data. This change adjusts the length when it looks incorrect
and the running kernel is FreeBSD 11.3 or above.

Fixes golang/go#30899.

Change-Id: Ia58d8b4bd4caf3783d2e38161ee4afd1a64ca522
Reviewed-on: https://go-review.googlesource.com/c/net/+/168297
Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-03-20 06:40:53 +00:00
Mikio Hara
d196dffd7c Revert "ipv4: work around FreeBSD 12 kernel running COMPAT_FREEBSD32"
This reverts commit 7a92b5139a.

Reason for revert: not completely functional on FreeBSD 12 or above and
broke FreeBSD 11 or below.

Change-Id: Icd43d9ecebc0059a577751802e589a6e5f0cd363
Reviewed-on: https://go-review.googlesource.com/c/net/+/168078
Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
Reviewed-by: Mikio Hara <mikioh.public.networking@gmail.com>
2019-03-18 22:16:13 +00:00
Mikio Hara
7a92b5139a ipv4: work around FreeBSD 12 kernel running COMPAT_FREEBSD32
On FreeBSD 12 kernel running COMPAT_FREEBSD32, it looks like the system
call recvmsg always returns an incorrect​ length for the out-of-band
data. This change adjusts the length when it looks incorrect.

Fixes golang/go#30899.

Change-Id: Ibb0cbcf9b1f5f959279c20395916d47bd75d289c
Reviewed-on: https://go-review.googlesource.com/c/net/+/168077
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-03-18 21:45:11 +00:00
Mikio Hara
7949ac6f08 ipv4: skip tests on aix, fuchsia and hurd
Also marks test helper functions.

Change-Id: I3417885fb81c8ab27cdfbe80c83270b94b878862
Reviewed-on: https://go-review.googlesource.com/c/net/+/167339
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:01:53 +00:00
Mikio Hara
511f7948e3 ipv4: replace errOpNoSupport with errNotImplemented
Change-Id: Ia1ba33c01c571cfca14921e6fe963b63e10dec3c
Reviewed-on: https://go-review.googlesource.com/c/net/+/167337
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:35 +00:00