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

Check dual-stack support for OpenBSD and other platforms #25

Closed
stv0g opened this issue Jun 14, 2023 · 1 comment
Closed

Check dual-stack support for OpenBSD and other platforms #25

stv0g opened this issue Jun 14, 2023 · 1 comment

Comments

@stv0g
Copy link
Collaborator

stv0g commented Jun 14, 2023

// BUG(rsc,mikio): On DragonFly BSD and OpenBSD, listening on the
// "tcp" and "udp" networks does not listen for both IPv4 and IPv6
// connections. This is due to the fact that IPv4 traffic will not be
// routed to an IPv6 socket - two separate sockets are required if
// both address families are to be supported.
// See inet6(4) for details.

Source: https://go.dev/src/net/ipsock.go

Workaround: Open two sockets for DragonFly and OpenBSD.

This issue does not seem to affect Windows.

@stv0g
Copy link
Collaborator Author

stv0g commented Jun 23, 2023

We now support listening on multiple addresses to for all platforms.

If no listen address is configured explicitly, we automatically listen on all available addresses.

In this case:

  • OpenBSD and DragonFly BSD will open two sockets. One for IPv4 (udp4) and another one for IPv6 (udp6)
  • Other platforms open a UDP socket which receives traffic from both address families (udp)

We don't support listening on multiple addresses of the same address familiy yet.
In order to support this, we must keep track over which socket we have received data from a peer to choose the correct socket.

Open question: which socket should be used if we initiate a handshake and have not received data from a peer?

Related: rosenpass/rosenpass#77

@stv0g stv0g closed this as completed Jun 23, 2023
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

1 participant