]> git.feebdaed.xyz Git - 0xmirror/msquic.git/commit
Fix QTIP port selection (#5626)
authorGuillaume Hetier <guhetier@microsoft.com>
Wed, 26 Nov 2025 19:56:31 +0000 (11:56 -0800)
committerGitHub <noreply@github.com>
Wed, 26 Nov 2025 19:56:31 +0000 (11:56 -0800)
commit3f321b6eada56432d6830bd95c700458644e189a
treee0f7359af17686a84413ca9b0b9f0494843ff045
parent51aabfb078921833a259a4fadb19ea4586291d38
Fix QTIP port selection (#5626)

## Description

Fixes #5346.

When creating a QTIP listener with a wildcard port:
- a UDP socket is created first (to reserve the UDP port as XDP will
take it over), and the OS would assign an ephemeral port to it
- a TCP socket is created second (to reserve the TCP port as XDP will
take it over)
- but instead of re-using the same port, the initial config was re-used,
and the OS would assign a different ephemeral port
- this second port would override the first one in the MsQuic socket
config

The main consequences of this bug are:
- the right UDP port was not reserved when creating a listener with a
wildcard port
- if later on, the OS assigned the UDP port matching the listener TCP
port, MsQuic would fail to create a binding (causing the test failure we
observed)

Creating a listener without a port set is largely a test scenario.
Creating a client connection with an unspecified a port was ok because
only a TCP or a UDP socket is created for client connection.

## Testing

C/I. We should add some test to validate port reservation in XDP
scenarios, but it will take efforts to enable test to create sockets
cross-platform.

## Documentation

N/A
src/platform/datapath_raw_win.c