New issue
Advanced search Search tips

Issue 858892 link

Starred by 4 users

Issue metadata

Status: Available
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature



Sign in to add a comment

TCPServerSocket should allow control of IPV6_V6ONLY option

Project Member Reported by johnchen@chromium.org, Jun 29 2018

Issue description

Currently, it is difficult to use net::TCPServerSocket class to listen on both IPv4 and IPv6 ports, because the app has no easy way to determine if listening to an IPv6 port causes the OS to also listen on IPv4. Most socket implementations use IPV6_V6ONLY option to control IPv6 operation, but the setting of this option is inconsistent across platforms:

* On Windows, this option is explicitly set to false (see https://chromium.googlesource.com/chromium/src/+/69.0.3464.0/net/socket/socket_descriptor.cc#28)
* On Linux, this option is not explicitly set, and relies on OS default, which can be changed by admins (see ipv6 man page on Linux)
* On Mac, this options is also not explicitly set, and apparently always defaults to true.

It would be great for apps if net::TCPServerSocket provides a way to control the IPV6_V6ONLY option of the underlying socket.
 
Labels: -Type-Bug Type-Feature
Labels: Network-Triaged
I believe if you do use a net::IPEndPoint of net::ADDRESS_FAMILY_IPV6 for TCPServerSocket::Listen(ip_endpoint), you should be able to use only IPv6.

Is that not the case?
Based on my observation, when my app listens to specific port using IPV6 address ::0 on Linux, the OS automatically listens to the same port using IPv4 address 0.0.0.0 as well. The IPV6_V6ONLY option is supposed to disable this behavior, but I have no way to access the underlying socket through net::TCPServerSocket abstraction.
Status: Available (was: Untriaged)
Got it. I am marking this as Available. Having an API on TCPServerSocket to allow control of IPV6_V6ONLY seems reasonable to me.
Just bumping this so it doesn't go stale. ChromeDriver still wants this option. Our current solution is complicated and causes bugs like https://bugs.chromium.org/p/chromedriver/issues/detail?id=2541 to happen.

Sign in to add a comment