Skip to content

Commit 8acb578

Browse files
thomaseizingerdjc
authored andcommitted
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.
1 parent 52c7ad1 commit 8acb578

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

quinn-udp/src/unix.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,15 @@ mod gso {
986986
// As defined in linux/udp.h
987987
// #define UDP_MAX_SEGMENTS (1 << 6UL)
988988
match set_socket_option(socket, libc::SOL_UDP, libc::UDP_SEGMENT, GSO_SIZE) {
989-
Ok(()) => 64,
989+
Ok(()) => {
990+
// Disable GSO again globally to ensure we can selectively enable it via cmsg.
991+
// See:
992+
// - https://github.com/quinn-rs/quinn/issues/2575
993+
// - https://man7.org/linux/man-pages/man7/udp.7.html
994+
let _ = set_socket_option(socket, libc::SOL_UDP, libc::UDP_SEGMENT, 0);
995+
996+
64
997+
}
990998
Err(_e) => {
991999
crate::log::debug!(
9921000
"failed to set `UDP_SEGMENT` socket option ({_e}); setting `max_gso_segments = 1`"

0 commit comments

Comments
 (0)