aws/s2n-quic

Socket always binds to IPv4

Opened this issue · 1 comments

Problem:

Sometimes, we require our server to bind only to IPv6 ports. This can commonly happen when we would like another IPv4 application to share the port for example. The default IO provider (tokio), calls socket.set_only_v6(false) and provides no method of configuration. Therefore, when binding to an IPv6 address, the server will also listen on the IPv4 address at the same port.

Solution:

The set_only_ipv6 value should probably just be specifiable via the tokio IO provider builder, similar to reuse_addr and reuse_port. The appropriate set_only_v6 default value may be true, but users should be able to specify this without having to create an entire IO provider from scratch.

  • Does this change what s2n-quic sends over the wire? No
  • Does this change any public APIs? --> Yes, the tokio IO provider builder

Requirements / Acceptance Criteria:

Servers should be able to bind to an IPv6 address and port, and not be bound to the IPv4 port. Testing with `nmap -6 -sU -p ` should show if the port is open on IPv6, while `nmap -sU -p ` will show if the port is open on IPv4.

Out of scope:

N/A

Thanks for the issue! This looks like a reasonable change. We'll evaluate and prioritize a new builder method.