ipv6 addresses must be bracketed if using a port

The host/port splitting code will not pull out a port if there are >=2 colons[1].
Unit test code demos this [2].  Note other documentation gets this right[3].  Example IP came from this issue[4] and the unit tests[2].
See also: relevant RFCs [5] [6]

[1]618a3f561d/src/core/lib/gpr/host_port.cc (L81)
[2]618a3f561d/test/core/client_channel/resolvers/sockaddr_resolver_test.cc (L107)
[3]https://chromium.googlesource.com/external/github.com/grpc/grpc/+/chromium-deps/2016-07-19/src/core/ext/client_config/README.md
[4]https://github.com/grpc/grpc/issues/6623
[5]http://www.iana.org/go/rfc5952#section-6
[6]http://www.iana.org/go/rfc3986#section-3.2.3
pull/17192/head
Alex Lo 6 years ago committed by GitHub
parent 15be84ac2e
commit f932b8e2d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      doc/naming.md

@ -51,7 +51,9 @@ but may not be supported in other languages:
- `ipv6:address[:port][,address[:port],...]` -- IPv6 addresses
- Can specify multiple comma-delimited addresses of the form `address[:port]`:
- `address` is the IPv6 address to use.
- `address` is the IPv6 address to use. To use with a `port` the `address`
must enclosed in literal square brakets (`[` and `]`). Example:
`ipv6:[2607:f8b0:400e:c00::ef]:443` or `ipv6:[::]:1234`
- `port` is the port to use. If not specified, 443 is used.
In the future, additional schemes such as `etcd` could be added.

Loading…
Cancel
Save