Commit Graph

1472 Commits

Author SHA1 Message Date
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
Brad Fitzpatrick
461777fb6f http2: support getting the Server connection's base context from net/http
This is the x/net/http2 half of the fix. The net/http half is in CL 181260.

Updates golang/go#32476
Updates golang/go#30694

Change-Id: Ic25c678dad99acc4ae8d679384d9e9a38dc1291c
Reviewed-on: https://go-review.googlesource.com/c/net/+/181259
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-06-07 18:15:51 +00:00
Brad Fitzpatrick
26fcbda1b1 go.mod: add go language version
The go tool kept inserting "go 1.13" so I'm adding an explicit line so
it stops modifying my local files when I'm working on other changes.

Change-Id: I82b8de13a75271f04dce78f9e939aefe1d24fc6d
Reviewed-on: https://go-review.googlesource.com/c/net/+/181257
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-06-07 17:52:57 +00:00
Brad Fitzpatrick
d5cec38845 http2: disable a flaky test on Windows for now, add more logging
Updates golang/go#31260

Change-Id: Icf26461dc48f5f16a91a93df6aa78fec1338f51f
Reviewed-on: https://go-review.googlesource.com/c/net/+/181198
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2019-06-07 17:21:44 +00:00
Arthur Fabre
27ecd3f315 bpf: fix VM out of bounds LoadMemShift check
The bpf VM did not correctly check the bounds of LoadMemShift
instructions, as it used a size of 0 instead of the correct 1.

A LoadMemShift instruction 1 past the end of the input resulted in a
runtime panic:

    panic(0x5c1d40, 0x7cec00)
            /usr/local/go/src/runtime/panic.go:522 +0x1b5
    golang.org/x/net/bpf.loadMemShift(...)
            /home/afabre/go/pkg/mod/golang.org/x/net@v0.0.0-20190603091049-60506f45cf65/bpf/vm_instructions.go:137
    golang.org/x/net/bpf.(*VM).Run(0xc00000ec40, 0xc0000173c8, 0x2, 0x8, 0x2, 0xc0000173c8, 0x0)
            /home/afabre/go/pkg/mod/golang.org/x/net@v0.0.0-20190603091049-60506f45cf65/bpf/vm.go:131 +0xb0a

Fix this, and rework the out of bounds tests for load instructions to:

* Use an offset one past the end of the input, to catch this

* Use a filter that returns 1, to catch cases were the out of bounds
load does not cause a panic, but does not cause the VM to return 0.

Change-Id: I1e68886915207a34f59765805f907f36dc031f70
Reviewed-on: https://go-review.googlesource.com/c/net/+/180979
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2019-06-07 17:17:31 +00:00
Mykhailo Lesyk
1492cefac7 webdav: remove redundant trailing slash for root directory
Fixes golang/go#31983

Change-Id: I9925f392ea98cd6618551e936e1dbd5a2a9324c9
GitHub-Last-Rev: dba5c6876c
GitHub-Pull-Request: golang/net#42
Reviewed-on: https://go-review.googlesource.com/c/net/+/176737
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-06-06 17:38:56 +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
Michael Fraenkel
3ec1911272 http2: track reused connections
nextStreamID was used as a means to determine if the connection was
being reused. Multiple requests can see a new connection because the
nextStreamID is updated after a ClientTrace reports it is being reused.

Updates golang/go#31982

Change-Id: Iaa4b62b217f015423cddb99fd86de75a352f8320
Reviewed-on: https://go-review.googlesource.com/c/net/+/176720
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-05-14 14:07:10 +00:00
Brad Fitzpatrick
a4d6f7fead http2/h2demo: stop using gitlock, use Go modules
Updates golang/go#26872

Change-Id: If2a96708d1fcf43b7ce20a48fa5ae3492f970187
Reviewed-on: https://go-review.googlesource.com/c/net/+/176318
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-05-09 22:28:00 +00:00
Brad Fitzpatrick
f4e77d36d6 proxy: add ProxyFromEnvironmentUsing
Updates golang/go#31813

Change-Id: Ic05fcdb5881c9e01967697542228224611b7a73f
Reviewed-on: https://go-review.googlesource.com/c/net/+/175100
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jacob Blain Christen <dweomer5@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-05-03 19:29:46 +00:00
Jacob Blain Christen
7f726cade0 proxy: add Dial (with context)
The existing API does not allow client code to take advantage of Dialer implementations that implement DialContext receivers. This a familiar API, see net.Dialer.

Fixes golang/go#27874
Fixes golang/go#19354
Fixes golang/go#17759
Fixes golang/go#13455

Change-Id: I0f247783d2037da28c9917db99adda51db1647bd
GitHub-Last-Rev: b0a372707f
GitHub-Pull-Request: golang/net#38
Reviewed-on: https://go-review.googlesource.com/c/net/+/168921
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-05-02 18:39:28 +00:00
Kunpei Sakai
9ce7a6920f html: implement ParseWithOptions and ParseFragmentWithOptions
This commit newly introduces a type for configuring a parser
called ParseOption, and implements two functions depending on it.
Along with that, this introduces ParseOptionEnableScripting to
enable setting of the scripting flag.

Fixes golang/go#16318

Change-Id: Ie7fd7d8ce286e22e7f57182fc2ce353bce578db6
Reviewed-on: https://go-review.googlesource.com/c/net/+/174157
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2019-05-01 00:44:15 +00:00
Marcel van Lohuizen
4829fb13d2 idna: update to Unicode 11
Also adopt Unicode selection based on the Unicode
version used by the go binary, as is done in x/text.

Change-Id: I334897e15b2e6fcc6ca175e7eaaa6262ae838f80
Reviewed-on: https://go-review.googlesource.com/c/net/+/172738
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-04-24 11:20:56 +00:00
Volker Dobler
afe8014c97 publicsuffix: domain labels may not be empty
EffectiveTLDPlusOne hands it argument to PublicSuffix which produces
output for all its arguments, even for non-domain names like ".com.au"
and does not report an error.

This CL captures this type of malformed input to EffectiveTLDPlusOne
and returns an error if any label in the domain name is empty (or the
domain is fully qualified).
This is still not a proper input validation e.g. IP addresses can
still be fed into EffectiveTLDPlusOne without error.

Fixes golang/go#30652

Change-Id: I12b0945bc3c7e5d192a71c5488361a60a48454b1
Reviewed-on: https://go-review.googlesource.com/c/net/+/172537
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-04-24 02:48:45 +00:00
Tom Anthony
ce75fb3bc6 html: Add missing condition to 'in cell' insertion mode, required by spec
In section 12.2.6.4.15 of the spec, there is a condition that the current node is a td or th element, which is not implemented. This can lead to a panic when the open elements stack is popped whilst empty, as outlined in golang/go#30600. This commit implements that check.

Fixes golang/go#30600

Change-Id: I4837815e2edce21b58a985a100d93d146bf71e24
GitHub-Last-Rev: 79084c5a84
GitHub-Pull-Request: golang/net#41
Reviewed-on: https://go-review.googlesource.com/c/net/+/172377
Reviewed-by: Kunpei Sakai <namusyaka@gmail.com>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Run-TryBot: Kunpei Sakai <namusyaka@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-04-24 02:45:59 +00:00
Kunpei Sakai
574d568418 html: add "in head noscript" im support
In the spec 12.2.6.4.5, the "in head noscript" insertion mode is defined.
However, this package and its parser doesn't have the insertion mode,
because the scripting=false case is not considered currently.

This commit adds a test and a support for the "in head noscript"
insertion mode. This change has no effect on the actual behavior.

Updates golang/go#16318

Change-Id: I9314c3342bea27fa2acf2fa7d980a127ee0fbf91
Reviewed-on: https://go-review.googlesource.com/c/net/+/172557
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2019-04-24 02:42:50 +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
1f3472d942 icmp: add port for aix/ppc64
Change-Id: I719dd53a949725b4d63ecba37fad530de731d568
Reviewed-on: https://go-review.googlesource.com/c/net/+/170560
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:53 +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
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
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
marius a. eriksen
1da14a5a36 http2: don't hang a stream if trailers values are not provided
Pre-declared trailers are written after a server's request handler
returns, in which case the trailer header frame is also responsible
for closing the stream. However, if the server handler does not
define a trailer header value before returning, the headers are empty
and no header frame is written. In this case, the stream would simply
hang.

This change fixes this by closing the stream if there are no header
values but endStream is true. Some other options to consider:

1. Reset the stream with an error; the user didn't define a trailer value
   as they said they would. From my brief reading of the http/2 RFC,
   this isn't actually required.
2. Send an explicitly empty header value.

Change-Id: I07e01250df60ac33fa6d34beb81ec2fa7e43c146
GitHub-Last-Rev: dfc532d785
GitHub-Pull-Request: golang/net#31
Reviewed-on: https://go-review.googlesource.com/c/net/+/161958
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-04-15 21:45:37 +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
Nigel Tao
eb5bcb51f2 publicsuffix: add a who-manages-this example
Change-Id: Ia5d7ed3e49197688f246e7148288fa2391a18deb
Reviewed-on: https://go-review.googlesource.com/c/net/+/170497
Reviewed-by: Volker Dobler <dr.volker.dobler@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-04-04 23:23:15 +00:00
chigotc
b630fd6fe4 http2/h2i: add port for aix/ppc64
Change-Id: I46758e5685a0eebbe38b0f228fbc084d9ead35b7
Reviewed-on: https://go-review.googlesource.com/c/net/+/170561
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-04-03 14:48:56 +00:00
Volker Dobler
74de082e2c publicsuffix: update table to latest list from publicsuffix.org
Update the list to revision 0e2a405f597a3c1be456d704b42bdd5e0d4954bb
(2019-02-21T09:23:55Z)

Change-Id: If3f121fb3897920e1bcd22d5fdc6b515e287e00d
Reviewed-on: https://go-review.googlesource.com/c/net/+/169377
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2019-03-28 23:00:28 +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
9bff7f1a9d bpf: use of nettest
To ensure tests never fail on IPv6-only kernels.

Change-Id: I40713d00ba6066da69c84f5cd506a2243360e057
Reviewed-on: https://go-review.googlesource.com/c/net/+/169577
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:19 +00:00
Mikio Hara
710a502c58 nettest: add SupportsRawSocket
Also updates API docs.

Change-Id: I0c744a286bf637270156101bfdee1e87e306fa5e
Reviewed-on: https://go-review.googlesource.com/c/net/+/169539
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-27 09:11:25 +00:00
Michael Fraenkel
74e053c68e http2: make empty method mean GET
We document that "" means "GET" for Request.Method.

Updates golang/go#31061

Change-Id: I41d0c7361e6ad14e9c04c120aed8a30295b1f974
Reviewed-on: https://go-review.googlesource.com/c/net/+/169557
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-03-27 02:57:41 +00:00
Mikio Hara
15845e8f86 nettest: move helpers from internal/nettest package
This change moves some test helper functions from the internal/nettest
package to avoid vendoring of internal/nettest package in the standard
library.

Change-Id: I2dfe6817bc660a76919460c3975b72be1a2b65f3
Reviewed-on: https://go-review.googlesource.com/c/net/+/123055
Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-03-26 09:03:15 +00:00
Mikio Hara
a33f666f30 html: gofmt -w -s
Change-Id: I2da52ff2afbf0417dbe6c08105fafeb168e936ee
Reviewed-on: https://go-review.googlesource.com/c/net/+/169358
Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
2019-03-26 08:36:53 +00:00
Tom Anthony
e3b2ff56ed html: fix parsing where nested tags of unknown types inadvertently close one another
The existing implementation behaves differently to all major browsers, for the instance where a self-closing element of an unknown tag type is the child of another element of an unknown tag type. The issue appears to be that nested tags of an differing unknown types will all have an atom value of 0 and `inBodyEndTagOther` will incorrectly match them to one another.

Fixes golang/go#30961

Change-Id: I62b0aa49c027c8432df7d077ffba135201b3b786
GitHub-Last-Rev: fb25181f9a
GitHub-Pull-Request: golang/net#37
Reviewed-on: https://go-review.googlesource.com/c/net/+/168638
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2019-03-24 22:39:53 +00:00
Matt Layher
addf6b3196 nettest: remove Go 1.6 compatibility code
Go 1.6 has been unsupported for some time now, so let's clean up
this unnecessary scaffolding code.

Change-Id: I9c4f05b2dd142226c65906f7a2d5327369d81ee5
Reviewed-on: https://go-review.googlesource.com/c/net/+/168800
Run-TryBot: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Mikio Hara <mikioh.public.networking@gmail.com>
2019-03-22 12:03:37 +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
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
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
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
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
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
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
Mikio Hara
5c2c250b6a icmp: make non-privileged tests more adaptive
Assuming every Linux kernel configures net.ipv4.ping_group_range well is
a bit naive.

Change-Id: Ibc2ecbad350238509e3988a1a12eef67c9b475a9
Reviewed-on: https://go-review.googlesource.com/c/net/+/167298
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-13 08:27:53 +00:00
Mikio Hara
c19f08b1b5 icmp: replace errOpNoSupport with errNotImplemented
Change-Id: Ibeb91d35c02e17ce1a9947389ce0e5c8c9d009ae
Reviewed-on: https://go-review.googlesource.com/c/net/+/167297
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-13 08:27:26 +00:00
Michael Matloob
d888771761 http2/h2demo: require golang.org/x/net@latest
Now that a pseudo-version of golang.org/x/net with h2demo carved exists,
we can depend on it. Add the dependency to h2demo's go.mod file.

Updates golang/go#30685

Change-Id: I3dbb2493d97be381350881228025d27c7e8e8623
Reviewed-on: https://go-review.googlesource.com/c/net/+/166857
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-03-11 18:33:53 +00:00