Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket always binds to IPv4 #2316

Open
jkalez opened this issue Sep 4, 2024 · 1 comment
Open

Socket always binds to IPv4 #2316

jkalez opened this issue Sep 4, 2024 · 1 comment

Comments

@jkalez
Copy link

jkalez commented Sep 4, 2024

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

@lrstewart
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants