Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions rs/moq-quic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Cherry-picked since the fork point:
- [`ecc0dcfd`](https://github.com/quinn-rs/quinn/commit/ecc0dcfdeaec996d276da31d836f965753b66ea4): truncate an application `CONNECTION_CLOSE` reason by the error code's actual width, so a four- or eight-byte code no longer overruns the frame's budget.
- [`0365181f`](https://github.com/quinn-rs/quinn/commit/0365181f2d1ee63606d43b6e858c4f70c5802c08) (moq-tokio's `quic::driver`): an ignored `ECONNRESET` or `EMSGSIZE` receive error counts toward the receive work budget, so a flood of them cannot hold the endpoint task.
- [`f74e6a8a`](https://github.com/quinn-rs/quinn/commit/f74e6a8a15e5aa980044b7fa03a31878c6a8c65c): check a DATAGRAM frame's encoded size against `max_datagram_frame_size`, and drop rather than refuse one whose queue metadata overflows the receive buffer, so a datagram of the advertised maximum size no longer closes the connection.
- [`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.
Expand Down
16 changes: 12 additions & 4 deletions rs/moq-sock/src/udp/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,18 @@ impl UdpSocketState {
}?;
let family = info.iAddressFamily;
let is_ipv6 = family == c_int::from(WinSock::AF_INET6);
let v6only = unsafe {
get_socket_option::<u32>(&*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::<u32>(
&*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(|| {
Expand Down