aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid du Colombier <0intro@gmail.com>2016-11-03 11:50:45 +0100
committerDavid du Colombier <0intro@gmail.com>2016-11-03 13:58:02 +0000
commit5ac3e7d6a7717bf2f722803e1852ba991af4e724 (patch)
treee527c2e9613ba1b29bf7df517c8dbe03a99220b5 /src
parent97b49f660cbb37ff6789dbb92b1a6ded394d3d7d (diff)
downloadgo-5ac3e7d6a7717bf2f722803e1852ba991af4e724.tar.xz
net: disallow dialing and listening on port > 65535 on Plan 9
Since Dial(":80") was implemented on Plan 9 (CL 32593), TestProtocolDialError is failing because dialing a port superior to 65535 is supported on Plan 9. This change disallows dialing and listening on ports superior to 65535. Fixes #17761. Change-Id: I95e8a163eeacf1ccd8ece7b650f16a0531c59709 Reviewed-on: https://go-review.googlesource.com/32594 Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src')
-rw-r--r--src/net/ipsock_plan9.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/net/ipsock_plan9.go b/src/net/ipsock_plan9.go
index 7046a05f34..b7fd344c8a 100644
--- a/src/net/ipsock_plan9.go
+++ b/src/net/ipsock_plan9.go
@@ -119,6 +119,11 @@ func startPlan9(ctx context.Context, net string, addr Addr) (ctl *os.File, dest,
return
}
+ if port > 65535 {
+ err = InvalidAddrError("port should be < 65536")
+ return
+ }
+
clone, dest, err := queryCS1(ctx, proto, ip, port)
if err != nil {
return