Commit Graph

1466 Commits

Author SHA1 Message Date
CarlosEDP
3747f61487 go fmt files 2019-05-20 17:50:38 -03:00
CarlosEDP
b46596991b Add build defensive for riscv64 files 2019-05-20 17:26:02 -03:00
CarlosEDP
0f12914c28 ipv4, ipv6, internal/socket: add riscv64 support 2019-05-18 14:06:42 -03:00
CarlosEDP
21818d7212 Added riscv64 definitions for IPv4 and IPv6 2019-05-17 23:51:19 -03:00
CarlosEDP
3676413c3a Build for riscv64 on linux 2019-05-17 23:37:59 -03:00
CarlosEDP
0fab69baa5 Add riscv64 support 2019-05-17 23:26:53 -03: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
Michael Matloob
12eef18f75 all: add go.mod files, carve h2demo into separate module
This change adds a go.mod and go.sum file to this repo, following the
requirements stated in bcmills's comment here:
https://golang.org/issue/28136#issuecomment-462971974. It's
important to note that we will not be
adding versions to the repo for now.

This change also creates a new module with the module path
golang.org/x/net/http2/h2demo, and moves the h2demo command into it.
This is done by adding a go.mod file in the http2/h2demo directory.
As a result, the h2demo command and its dependencies are removed
from this and later pseudo-versions of the golang.org/x/net module.

The change was generated using Go 1.12.

Updates golang/go#28136
Fixes golang/go#30685

Change-Id: Ia5b0f6623c3374355b76106432190a0c9acf3d05
Reviewed-on: https://go-review.googlesource.com/c/net/+/162822
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-03-11 17:56:48 +00:00
Mikio Hara
56fb01167e icmp: add simple multipart message validation
This change adds simple validation for multipart messages to avoid
generating incorrect messages and introduces RawBody and RawExtension
to control message validation. RawBody and RawExtension are excluded
from normal message processing and can be used to construct crafted
messages for applications such as wire format testing.

Fixes golang/go#28686.

Change-Id: I56f51d6566142f5e1dcc75cfce5250801e583d6d
Reviewed-on: https://go-review.googlesource.com/c/net/+/155859
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-11 03:10:20 +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
784e4c8c97 ipv4: drop support for go1.8 or below
Change-Id: I27e30dbb0cbbd5c3dd53333882a794f0ef1092ff
Reviewed-on: https://go-review.googlesource.com/c/net/+/162598
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:25 +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
b774fd8d5c ipv4: fix error values on header manipulation
This change makes header manipulation methods and functions return a nil
header error if the receiver or wire header is nil, a header too short
error if the header length field value of receiver or wire header is
short, and a extension header error if the wire extnsion header is
short.

Also replaces syscall.EWINDOWS or syscall.EPLAN9 with more descriptive,
platform independent error values.

Change-Id: I923fb60b1d68857cffc9df20f3f6cb2babbcdb1f
Reviewed-on: https://go-review.googlesource.com/c/net/+/129136
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2019-03-10 01:40:29 +00:00