fix(unix): disable GSO after probing

After probing the given socket for GSO support, we need to disable this option
again to ensure we can selectively enable it via our cmsg codepaths.
This commit is contained in:
Thomas Eizinger
2026-03-24 12:07:54 +11:00
committed by Dirkjan Ochtman
parent 52c7ad1898
commit 8acb578f10
+9 -1
View File
@@ -986,7 +986,15 @@ mod gso {
// As defined in linux/udp.h
// #define UDP_MAX_SEGMENTS (1 << 6UL)
match set_socket_option(socket, libc::SOL_UDP, libc::UDP_SEGMENT, GSO_SIZE) {
Ok(()) => 64,
Ok(()) => {
// Disable GSO again globally to ensure we can selectively enable it via cmsg.
// See:
// - https://github.com/quinn-rs/quinn/issues/2575
// - https://man7.org/linux/man-pages/man7/udp.7.html
let _ = set_socket_option(socket, libc::SOL_UDP, libc::UDP_SEGMENT, 0);
64
}
Err(_e) => {
crate::log::debug!(
"failed to set `UDP_SEGMENT` socket option ({_e}); setting `max_gso_segments = 1`"