From 45efd0377815da2aaab8d787b123e32b203aeaf2 Mon Sep 17 00:00:00 2001 From: zerox80 Date: Sun, 11 Oct 2026 15:22:18 +0200 Subject: [PATCH 1/2] fix(quic): query IPV6_V6ONLY only on IPv6 sockets Cherry-picked from quinn-rs/quinn 17596ddefb09dae895129520824055d0ac8da5d5 Co-Authored-By: Claude Opus 5.5 --- rs/moq-sock/src/udp/windows.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/rs/moq-sock/src/udp/windows.rs b/rs/moq-sock/src/udp/windows.rs index 5773905c30f..e82eb6cc6da 100644 --- a/rs/moq-sock/src/udp/windows.rs +++ b/rs/moq-sock/src/udp/windows.rs @@ -59,10 +59,18 @@ impl UdpSocketState { }?; let family = info.iAddressFamily; let is_ipv6 = family == c_int::from(WinSock::AF_INET6); - let v6only = unsafe { - get_socket_option::(&*socket.0, WinSock::IPPROTO_IPV6, WinSock::IPV6_V6ONLY as _) - }?; - let is_ipv4 = family == c_int::from(WinSock::AF_INET) || v6only == 0; + let is_dual_stack = is_ipv6 && { + let v6_only = unsafe { + get_socket_option::( + &*socket.0, + WinSock::IPPROTO_IPV6, + WinSock::IPV6_V6ONLY as _, + ) + }?; + v6_only == 0 + }; + + let is_ipv4 = family == c_int::from(WinSock::AF_INET) || is_dual_stack; // We don't support old versions of Windows that do not enable access to `WSARecvMsg()` let wsa_recvmsg = resolve_wsa_recvmsg(&*socket.0).ok_or_else(|| { From fcc63131a8e6a247303b6463d6391a9e1071cbd3 Mon Sep 17 00:00:00 2001 From: Zac Shenker Date: Mon, 19 Oct 2026 16:09:12 -0600 Subject: [PATCH 2/2] docs(quic): list 17596dde Co-Authored-By: Claude Opus 5.5 --- rs/moq-quic/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/rs/moq-quic/README.md b/rs/moq-quic/README.md index 7ea6dad5580..855c9469f28 100644 --- a/rs/moq-quic/README.md +++ b/rs/moq-quic/README.md @@ -12,6 +12,7 @@ That covers every quinn security advisory published through 2026-09-30. Cherry-picked since the fork point: - [`48854d48`](https://github.com/quinn-rs/quinn/commit/48854d48635875d259a95973cc0575db8c1792a4): accept non-minimally encoded integer transport parameters, as RFC 9000 section 16 allows. +- [`17596dde`](https://github.com/quinn-rs/quinn/commit/17596ddefb09dae895129520824055d0ac8da5d5) (`moq_sock::udp`): on Windows, query `IPV6_V6ONLY` only on IPv6 sockets, so Winsock refusing the option on an IPv4 socket cannot fail endpoint creation. The fork never merges upstream. Upstream fixes are cherry-picked by hand, and the crate keeps quinn's formatting (rustfmt defaults) so the patches apply cleanly.