Commit 6b901a3
quinn-udp: sanitise
In order to perform GSO, an application needs to batch datagrams
together into a big buffer. As part of such a batch, the last datagram
is allowed to be less than the `segment_size` as that still allows the
kernel to unambigously segment the content into individual packets.
When GSO gets disabled at runtime due to lack of driver support,
applications need to segment such a prepared batch themselves into
individual `Transmit`s. Doing that may lead to situations in which a
`Transmit` is handed to `quinn-udp` which still has the original
`segment_size` set, yet its content is shorter than that.
Not all kernels like that. Specifically, it has been observed that
Android is particularly picky about these parameters.
We already sanitise the `segment_size` such that it is not set when it
is equal to the content length. To further increase the robustness of
`quinn-udp`, we extend this check to only set it when it is strictly
less than the content length.
Related: #2201
Related: #2145
Related: firezone/firezone#8932segment_size
1 parent 458295c commit 6b901a3
1 file changed
+5
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
612 | 612 | | |
613 | 613 | | |
614 | 614 | | |
615 | | - | |
616 | | - | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
617 | 619 | | |
618 | 620 | | |
619 | | - | |
| 621 | + | |
620 | 622 | | |
621 | 623 | | |
622 | 624 | | |
| |||
0 commit comments