mirror of
https://github.com/n0-computer/noq.git
synced 2026-09-16 16:25:08 +00:00
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:
committed by
Dirkjan Ochtman
parent
52c7ad1898
commit
8acb578f10
@@ -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`"
|
||||
|
||||
Reference in New Issue
Block a user