]> Cypherpunks repositories - gostls13.git/commit
net: fix looking up port numbers starting with numbers.
authorMorten Siebuhr <sbhr@sbhr.dk>
Fri, 19 Feb 2016 20:53:17 +0000 (21:53 +0100)
committerMikio Hara <mikioh.mikioh@gmail.com>
Fri, 15 Apr 2016 23:11:47 +0000 (23:11 +0000)
commit002c69e05d6a24693ac1052d98845ec635f34c19
tree7c2485abe3f199994d08d9f40e3c7ac0ba0a5a34
parentb6b4004d5a5bf7099ac9ab76777797236da7fe63
net: fix looking up port numbers starting with numbers.

LookupPort() correctly parses service names beginning with numerals by
implementing a new parser, mainly taken from strconv/atoi.go.

Also testes some previously undefined behaviours around port numbers
larger than 65535 that previously could lead to some tests fail with
EOPNOTSUPP (Operation Not Supported).

Fixes #14322

Change-Id: I1b90dbed434494723e261d84e73fe705e5c0507a
Reviewed-on: https://go-review.googlesource.com/19720
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
src/net/lookup.go
src/net/lookup_test.go
src/net/port.go [new file with mode: 0644]
src/net/port_test.go [new file with mode: 0644]