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

Be able to enforce the initialization of a TCP server with a dual stack #323

Open
dinosaure opened this issue Sep 30, 2020 · 3 comments
Open

Comments

@dinosaure
Copy link
Member

Highlighted by @hannesm here: #270 (comment), It's not possible to enforce a server to be only initialized on an IPv6 sockaddr. Lwt.setsockopt should fix the problem.

@hannesm
Copy link
Member

hannesm commented Sep 30, 2020

the issue is a bit more delicate when binding a socket to PF_INET inet6_addr_any:

  • Linux opens a dual V4 and V6 socket
  • macos & FreeBSD open a V6 only socket

the solution is to call setsockopt fd IPV6_ONLY false in a case where a dual stack socket is requested, and the same with true as last argument if a V6 only socket is requested. AFAICT the information whether a dual or v6-only socket is requested is atm not passed through in conduit, and thus the setsockopt cannot be done.

@vog
Copy link

vog commented Sep 30, 2020

I fully agree to @hannesm, and would like to stress one detail:

  • This issue should not be about how to initialize a v6-only service, but how to portably and reliably initialize a v4+v6 service.

@hannesm hannesm changed the title Be able to enforce the initialization of a TCP server with an IPv6 only Be able to enforce the initialization of a TCP server with a dual stack Sep 30, 2020
@dinosaure
Copy link
Member Author

Ok, I will propose something when #324 will be merged - to avoid any confusion between conduit-lwt/conduit-mirage and to still be homogeneized.

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

No branches or pull requests

3 participants