-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
IPv4 connections to quic-go server fail on FreeBSD #4105
Comments
The attached sys_conn_oob.txt reverts to the previous behaviour, where an IPv4-mapped IPv6 address is treated as an IPv4 address. This corrects the behaviour on FreeBSD and still works on Linux (at least Ubuntu 22.04.3 LTS). I can't check MacOS. Note that a complete fix to make quic-go v0.39.0 server work on FreeBSD also requires the fix to #4106. |
@peterjeremy Can you submit a PR with the fix please? |
I can't reproduce this. Connecting to google.com with an IPv4-mapped IPv6 address ( |
Closing, since this is not reproducible. Please comment here / reopen the issue with more details on how to reproduce it if you think this is incorrect. |
Perhaps this information will be useful
% go run example/echo/echo.go goroutine 1 [running]: netstat -na | grep udp uname -a But if you apply attached https://github.com/quic-go/quic-go/files/12787012/sys_conn_oob.txt |
I can reproduce it in Yggdrasil's Go implementation (version 0.5.2), which uses quic-go 0.39.3: https://github.com/yggdrasil-network/yggdrasil-go/blob/develop/go.mod I have a FreeBSD 12.3 VPS that only has IPv4, and I got stumped for hours trying to get Yggdrasil to open a UDP/QUIC port. Even at the most verbose level of logging I didn't get any clues on what went wrong; it just told me it opened a listener at |
@temtemy If you think there's still an issue with the current release, please open a new issue. |
quic-go uses dual-stack sockets so incoming IPv4 connections appear as IPv4-mapped IPv6 connections (see RFC2553 §3.7). #3881 changed the behaviour of the OOB data associated with the connection (
quic.sconn
) in this case (see the change toOOB()
in sys_conn_oob.go): Previously, an IPv4-mapped address was treated as IPv4 and would result in astruct in_pktinfo
being attached (this doesn't exist on FreeBSD so the OOB data is empty). The current behaviour is that an IPv4-mapped address is treated as IPv6 and results in astruct in6_pktinfo
being attached. FreeBSD doesn't supportstruct in6_pktinfo
for IPv4 addresses and thesendmsg
call that responds to the incoming connection will return EINVAL.(Note that FreeBSD recommends that separate IPv4 and IPv6 sockets should be used rather than dual-stack sockets for security reasons - see the Interaction between IPv4/v6 sockets section of inet6(4)).
The text was updated successfully, but these errors were encountered: