Commit Graph

84 Commits

Author SHA1 Message Date
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
Tobias Klauser
c8589233b7 internal/socket: remove unused sizeofMmsghdr const
Change-Id: I6f66e2fd93916438ad959de469ee081b7085fe1a
Reviewed-on: https://go-review.googlesource.com/c/net/+/195597
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-09-16 14:08:28 +00:00
Ainar Garipov
a7b16738d8 all: fix typos
Change-Id: I86005e1f17747e4ffe4fc544546e980b987bad36
Reviewed-on: https://go-review.googlesource.com/c/net/+/193799
Reviewed-by: Toshihiro Shiino <shiino.toshihiro@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-09-09 00:30:24 +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
Tobias Klauser
3f473d35a3 internal/socket: add support for freebsd/arm64
Updates golang/go#24715

Change-Id: I4e87b6101069eb9ff745fdfac6d4f6b4884a995c
Reviewed-on: https://go-review.googlesource.com/c/net/+/181618
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-11 14:12:13 +00:00
Tobias Klauser
dbab0cf9d9 internal/socket: add support for openbsd/arm64
Updates golang/go#31656

Change-Id: I238655c111e8422c60d20d853aeb965be16c1c7e
Reviewed-on: https://go-review.googlesource.com/c/net/+/181617
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-11 14:11:12 +00:00
Tobias Klauser
60506f45cf internal/socket: add support for netbsd/arm64
Updates golang/go#30824

Change-Id: I872b725d6640e29570652171b6c45634fc21a461
Reviewed-on: https://go-review.googlesource.com/c/net/+/179939
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
2019-06-03 09:10:49 +00:00
Tobias Klauser
f3200d17e0 internal/socket: remove leftover AF_* and SOCK_RAW constants on aix
Follow-up for CL 53310 which changed internal/socket to use these
constants from golang.org/x/sys/unix

Change-Id: I40fde84c875995fbeef2d21f8e05f5ba27b11098
Reviewed-on: https://go-review.googlesource.com/c/net/+/178557
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-05-22 15:58:17 +00:00
Tobias Klauser
fa69b94a3b internal/socket: use AF_* and SOCK_RAW constants from x/sys
Use the AF_UNSPEC, AF_INET, AF_INET6 and SOCK_RAW constants from
golang.org/x/sys instead of locally deriving them from the C headers (or
hard coding them in the case of Windows).

Change-Id: I37fe61d0435b6c615cd767eef38380db4b4af7b1
Reviewed-on: https://go-review.googlesource.com/c/net/+/53310
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-05-22 13:53:03 +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
457ff44d03 internal/socket: add port for aix/ppc64
This commit adds support for aix/ppc64 in internal/socket, for both
gccgo and gc.

Change-Id: Ic607e45d73be49cd0ed3ca4f60a967c306602367
Reviewed-on: https://go-review.googlesource.com/c/net/+/170557
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:07 +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
77544e6953 all: make bit clear operator explicitly
Change-Id: If72588778b815bc5d8f3e9f41d888cffc0d2a18d
Reviewed-on: https://go-review.googlesource.com/c/net/+/168298
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:12:53 +00:00
Mikio Hara
c1c748415a internal/socket: drop support for go1.8 or below
Change-Id: I3dcc786d4e9196bfba7e139948ccf459d28675af
Reviewed-on: https://go-review.googlesource.com/c/net/+/162597
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:08 +00:00
Mikio Hara
16b79f2e4e internal/socket: use correct cmsg alignment for netbsd/arm
The NetBSD arm port requires 64-bit alignment for cmsgs.

Change-Id: I619a205b4ff1b292b4d9eb2565799fe2c0a41b9f
Reviewed-on: https://go-review.googlesource.com/c/164777
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-01 23:13:41 +00:00
Mikio Hara
312bce6e94 internal/socket: make not implemented errors more descriptive
Change-Id: I7c1447849dc664ae54229345f2fce8f59204ecdf
Reviewed-on: https://go-review.googlesource.com/c/150117
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-02-27 02:21:44 +00:00
Tobias Klauser
a67830ca58 internal/nettest: drop causesIPv6Crash
The causesIPv6Crash helper function was only needed on macOS 10.8 and
before. However, Go 1.11 requires at least macOS 10.11, so drop the
check altogether. Also remove the unused implementations for all other
geese.

Change-Id: I7459f942374e7e2e6c14b787e2dfc493de67bedc
Reviewed-on: https://go-review.googlesource.com/c/156497
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-07 15:50:40 +00:00
Joel Sing
e147a91383 internal/socket: use correct cmsg alignment for openbsd/arm
The OpenBSD armv7 port requires 64-bit alignment for cmsgs.

Change-Id: Ibb1c5dc32c9e0851d0ee23b4ebdb316d7ed79629
Reviewed-on: https://go-review.googlesource.com/c/154397
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-12-17 02:32:33 +00:00
Keith Randall
adae6a3d11 internal/socket: use libc calls on darwin
Use libc calls instead of raw syscalls on Darwin.

Change-Id: I0319ae61e3575e7f76b975b9325c9078ab3440d5
Reviewed-on: https://go-review.googlesource.com/c/149617
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-11-14 22:03:01 +00:00
Mikio Hara
03003ca0c8 internal/socket: simplify nested if-blocks
Change-Id: I9f5fa605d9dc4047f916d9adc998ed23a65839ed
Reviewed-on: https://go-review.googlesource.com/c/148357
Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-11-08 08:20:09 +00:00
Michael Stapelberg
a544f70c90 internal/socket: update zoneCache on cache misses to cover appearing interfaces
Updates golang/go#28535

Change-Id: Id653b21b4d893cc8b6b9a74b129d1ce9b7e26a9f
Reviewed-on: https://go-review.googlesource.com/c/147739
Reviewed-by: Mikio Hara <mikioh.public.networking@gmail.com>
Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
2018-11-07 09:39:36 +00:00
chigotc
9b4f9f5ad5 internal/nettest: add AIX operating system
This commit adds AIX operating system to internal/nettest package.

It also disables unixpacket network.

Change-Id: Ie1a0b5c02d41ede7297c3706f6967be3438321a5
Reviewed-on: https://go-review.googlesource.com/c/144077
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-10-23 16:26:49 +00:00
Mikio Hara
26e67e76b6 internal/socks: fix socket descriptor leakage in Dialer.Dial
Fixes golang/go#27630.

Change-Id: Id44ade435733ffcd2fc8159ea9ea3287baadf97a
Reviewed-on: https://go-review.googlesource.com/134755
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-09-11 22:03:05 +00:00
Mikio Hara
4d581e05a3 all: re-adjust build constraints for JS and NaCl
This change fixes the build breakage of h2i on JS and NaCl, and avoids
using unintentional code path on JS.

Change-Id: Ib08f0f6d1d79aecc9bf1e9ee7de52b0a57c22baf
Reviewed-on: https://go-review.googlesource.com/122539
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-07-09 03:26:41 +00:00
Mikio Hara
75944861c7 internal/socks: add DialWithConn method to Dialer
This change adds DialWithConn method for allowing package users to use
own net.Conn implementations optionally.

Also makes the deprecated Dialer.Dial return a raw transport connection
instead of a forward proxy connection for preserving the backward
compatibility on proxy.Dialer.Dial method.

Fixes golang/go#25104.

Change-Id: I4259cd10e299c1e36406545708e9f6888191705a
Reviewed-on: https://go-review.googlesource.com/110135
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-05-30 17:52:07 +00:00
Mikio Hara
4ef37e81ae internal/iana: follow the move of TOS/TC registry
The registry for IPv4 TOS Byte and IPv6 Traffic Class Octet has been
moved to DSCP registry.

Also uses HTTPS for fetching any IANA resource.

Change-Id: I6a54defc2be4415fac084fcf9dfe0a481d72df33
Reviewed-on: https://go-review.googlesource.com/115220
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-05-30 16:39:01 +00:00
Tobias Klauser
8d282c4e20 internal/socks: fix typo in comment
Follow-up fix for CL 115237 which fixed the generated file.

Change-Id: I17881ce4ad1fc8f7d74b2b78e515d5d5430ad451
Reviewed-on: https://go-review.googlesource.com/115275
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-05-30 14:40:21 +00:00
Richard Musiol
640f4622ab internal/nettest: add js/wasm architecture
This commit adds the js/wasm architecture
to the internal/nettest package.

js/wasm currently uses the same fake networking as nacl.
Support for real networking will be added later.

Related to https://go-review.googlesource.com/c/go/+/109995

Change-Id: Ic914175374d7588dcb3c078da0e0e71c88323d1a
Reviewed-on: https://go-review.googlesource.com/110895
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-05-02 16:41:42 +00:00
Mikio Hara
61147c48b2 internal/{socks,sockstest}: new packages
This change factors out the code related to SOCKS protocol version 5
from the golang/x/net/proxy package and provides new SOCKS-specific
API to fix the following:
- inflexbility of forward proxy connection setup; e.g., no support for
  context-based deadline or canceling, no support for dial deadline,
  no support for working with external authentication mechanisms,
- useless error values for troubleshooting.

The new package socks is supposed to be used by the net/http package
of standard library and proxy package of golang.org/x/net repository.

Fixes golang/go#11682.
Updates golang/go#17759.
Updates golang/go#19354.
Updates golang/go#19688.
Fixes golang/go#21333.

Change-Id: I24098ac8522dcbdceb03d534147c5101ec9e7350
Reviewed-on: https://go-review.googlesource.com/38278
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-04-06 21:48:16 +00:00
Mikio Hara
08b7f81811 internal/iana: add address family number constants
Updates golang/go#24440.

Change-Id: Ic56bb1add57831d6c94f148d209417be5aa22cb2
Reviewed-on: https://go-review.googlesource.com/63996
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-03-19 15:13:56 +00:00
Mikio Hara
803fdb99c0 ipv4, ipv6, icmp, internal/socket: fix build on netbsd/arm
Fixes golang/go#24346

Change-Id: I6b32d79135c0843d62425f4cc4c18f5a0eb9efd3
Reviewed-on: https://go-review.googlesource.com/100155
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-03-13 05:12:57 +00:00
Kevin Burke
0ed95abb35 all: use HTTPS for iana.org links
iana.org, www.iana.org and data.iana.org all present a valid TLS
certificate, so let's use it when fetching data to avoid errors in
transit.

Change-Id: I1f295442d24a221fe2b722c4782dceee38b960ec
Reviewed-on: https://go-review.googlesource.com/89415
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-01-24 06:09:56 +00:00
Mikio Hara
d866cfc389 internal/socket: fix typos
Change-Id: Ic4e0dc9ef27522606061e2ab212a9d6b2b40dd64
Reviewed-on: https://go-review.googlesource.com/83435
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-12-12 00:56:08 +00:00
Mikio Hara
dc871a5d77 Revert "internal/socket: enable {recv,send}mmsg on NetBSD"
This reverts commit 5c0ad186f0.

Change-Id: I1b6fac0f88816f4464e732d2f8a3d5510decb255
Reviewed-on: https://go-review.googlesource.com/82697
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
2017-12-07 22:20:16 +00:00
Mikio Hara
5c0ad186f0 internal/socket: enable {recv,send}mmsg on NetBSD
Change-Id: Ide52e52d6859378bc12bb97081f63d657cb2a76f
Reviewed-on: https://go-review.googlesource.com/82455
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-12-07 21:46:16 +00:00
Mikio Hara
faacc1b5e3 internal/socket: add support for darwin/arm64
Fixes golang/go#22301.

Change-Id: I29f4f8806e10aad59cf7f984fd346acc216b0fd0
Reviewed-on: https://go-review.googlesource.com/79855
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-12-07 15:37:38 +00:00
Brad Fitzpatrick
a8b9294777 internal/nettest: skip unixpacket tests on netbsd/386
Updates golang/go#22927

Change-Id: I813b9ba92f9dd7e517385dc95df20691efee01a6
Reviewed-on: https://go-review.googlesource.com/80755
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-29 19:23:39 +00:00
Mikio Hara
a04bdaca5b internal/socket: make ipv4, ipv6 and icmp work again on android
On android, runtime.GOOS returns "android" instead of "linux".

Fixes golang/go#22115.

Change-Id: Idd24d5602f8fa9be1fca0b64bd8966849ea2b5e7
Reviewed-on: https://go-review.googlesource.com/67770
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-10-04 03:46:48 +00:00
Mikio Hara
4f8c76a975 internal/socket: don't crash with empty Message.Buffers
Fixes golang/go#22117.

Change-Id: I0d9c3e126aaf97cd297c84e064e9a521ddac626f
Reviewed-on: https://go-review.googlesource.com/67750
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-10-04 03:46:34 +00:00
Mikio Hara
dfe83d419c internal/socket: don't crash with corrupted control messages
Change-Id: I5c484662add4261f504607758521718f4c760375
Reviewed-on: https://go-review.googlesource.com/45294
TryBot-Result: Gobot Gobot <gobot@golang.org>
Run-TryBot: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-06-13 07:54:37 +00:00
Mikio Hara
3da985ce59 internal/socket: fix 386 emulation on amd64 for FreeBSD
Unlike routing messages, there's no need to tweak the alignment for
socket control messages on freebsd/386 emulation.

Change-Id: Iab4a2b05080868721f7e42cebd661d445f8c1030
Reviewed-on: https://go-review.googlesource.com/44391
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-05-29 21:49:44 +00:00
Mikio Hara
b8b13433cc internal/socket: add message IO functionality
This change adds portable message IO methods of Conn, IO message and
control message types, and parse methods for the types to provide
those functionality to the ipv4 and ipv6 packages.

With this change, the ipv4 and ipv6 packages can provide low-level
(but less heap allocation and the cost of invoking system calls) API
such as read and write operations for a batch of IO messages.

On vanilla linux/amd64 virtual machine:
BenchmarkUDP/Iter-1-2            1000000              8068 ns/op             408 B/op         14 allocs/op
BenchmarkUDP/Batch-1-2           1000000              8610 ns/op             440 B/op         14 allocs/op
BenchmarkUDP/Iter-2-2             500000             15390 ns/op             816 B/op         28 allocs/op
BenchmarkUDP/Batch-2-2            500000             12715 ns/op             696 B/op         20 allocs/op
BenchmarkUDP/Iter-4-2             200000             30763 ns/op            1632 B/op         56 allocs/op
BenchmarkUDP/Batch-4-2            300000             21853 ns/op            1216 B/op         32 allocs/op
BenchmarkUDP/Iter-8-2             100000             61460 ns/op            3264 B/op        112 allocs/op
BenchmarkUDP/Batch-8-2            200000             39048 ns/op            2256 B/op         56 allocs/op
BenchmarkUDP/Iter-16-2             50000            122408 ns/op            6528 B/op        224 allocs/op
BenchmarkUDP/Batch-16-2           100000             72728 ns/op            4336 B/op        104 allocs/op
BenchmarkUDP/Iter-32-2             30000            243137 ns/op           13056 B/op        448 allocs/op
BenchmarkUDP/Batch-32-2            50000            141332 ns/op            8496 B/op        200 allocs/op
BenchmarkUDP/Iter-64-2             20000            488125 ns/op           26112 B/op        896 allocs/op
BenchmarkUDP/Batch-64-2            30000            282078 ns/op           16816 B/op        392 allocs/op
BenchmarkUDP/Iter-128-2            10000            973752 ns/op           52224 B/op       1792 allocs/op
BenchmarkUDP/Batch-128-2           10000            551021 ns/op           33456 B/op        776 allocs/op
BenchmarkUDP/Iter-256-2             3000           1977852 ns/op          104448 B/op       3584 allocs/op
BenchmarkUDP/Batch-256-2           10000           1252596 ns/op           66736 B/op       1544 allocs/op
BenchmarkUDP/Iter-512-2             2000           4147495 ns/op          208896 B/op       7168 allocs/op
BenchmarkUDP/Batch-512-2            3000           2175774 ns/op          121128 B/op       2612 allocs/op

Change-Id: I3e08b28917b62dbea7936a86acb24e25ccaf5365
Reviewed-on: https://go-review.googlesource.com/38212
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-05-26 03:27:46 +00:00
Mikio Hara
f61a77393d internal/socket: add platform-dependent boilerplate files
Change-Id: I951a1abc36083401d183d61c58a8186b5ce41c6c
Reviewed-on: https://go-review.googlesource.com/38211
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-05-26 03:23:34 +00:00
Mikio Hara
445979b94b internal/iana: update DSCP names
As per RFC 3246, the registry renames the name for DSCP 101110
(binary) from EF PHB to EF to clarify that a particular per-hop
behavior (PHB) is called expedited forwarding (EF).

Change-Id: I022c2fcd4bb42a210ae5c6ec62200b7c5a638250
Reviewed-on: https://go-review.googlesource.com/43695
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-05-24 08:43:57 +00:00
Mikio Hara
aa0b216c89 Revert "ipv4, ipv6, internal/netreflect, bpf: fix the x/net build"
This reverts https://go-review.googlesource.com/c/37401

Updates golang/go#19051.

Change-Id: Ia3cbc42213e3c519f91650e6308a7ca1f56b6189
Reviewed-on: https://go-review.googlesource.com/37417
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-05-24 08:43:35 +00:00
Mikio Hara
e1564c30db internal/socket: merge internal/netreflect into internal/socket package
Updates golang/go#19051.

Change-Id: I4d86de8ea3fb03e40dd50bc0351562fbfa2c46a7
Reviewed-on: https://go-review.googlesource.com/38277
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-05-24 08:43:03 +00:00
Mikio Hara
50e760fb1d internal/socket: new package
This is a counterpart of https://go-review.googlesource.com/37039.

This change introduces a package that provides a portable interface
for the manipulation of sockets using either syscall.Conn and
syscall.RawConn interfaces or the internal/netreflect package
appropriately.

The package ensures that a package using this works with all supported
versions of the Go standard library.

Updates golang/go#19051.

Change-Id: Ib72ea369e6839e77fed6e35b9aedc364e73c51cb
Reviewed-on: https://go-review.googlesource.com/37035
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-05-24 08:41:53 +00:00
Brad Fitzpatrick
b64f02211f ipv4, ipv6, internal/netreflect, bpf: fix the x/net build
The x/net package is currently broken for Go 1.9 (#19051) so
I am unable to use trybots for x/net/http2.

This disables the tests for the broken stuff and makes things compile
at least, so x/net trybots aren't broken for others.

Updates golang/go#19051

Change-Id: I67401d7ad32d855e99a417545328eb4e803287cc
Reviewed-on: https://go-review.googlesource.com/37401
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Martin Möhrmann <moehrmann@google.com>
2017-02-23 22:48:12 +00:00
Mikio Hara
b4690f45fa internal/netreflect: don't build on go1.9 or above
This package doesn't work with Go 1.9 or above.
The bypass surgery for grafting the net and internal/poll packages of
Go 1.9 starts with disabling this packge.

Updates golang/go#19051.

Change-Id: I82d742d267f155cf440884e845b24402a5a5bfdf
Reviewed-on: https://go-review.googlesource.com/37034
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-02-15 21:59:08 +00:00