Commit 3f321b6
authored
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/A1 parent 51aabfb commit 3f321b6
1 file changed
+16
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
126 | 140 | | |
127 | 141 | | |
128 | 142 | | |
129 | 143 | | |
130 | 144 | | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
| 145 | + | |
139 | 146 | | |
140 | 147 | | |
141 | 148 | | |
142 | 149 | | |
143 | 150 | | |
144 | 151 | | |
145 | | - | |
146 | | - | |
147 | | - | |
| 152 | + | |
148 | 153 | | |
149 | 154 | | |
150 | 155 | | |
| |||
0 commit comments