From 2fbb2ddd1c71a1be9c9bf43277dfe131b5de4e6a Mon Sep 17 00:00:00 2001 From: Richard Gong Date: Thu, 29 May 2025 00:57:22 -0700 Subject: [PATCH] Catch EOPNOTSUPP as failure for opportunistic flags --- quinn-udp/src/unix.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/quinn-udp/src/unix.rs b/quinn-udp/src/unix.rs index 3e7212fb9..6557eac56 100644 --- a/quinn-udp/src/unix.rs +++ b/quinn-udp/src/unix.rs @@ -1018,7 +1018,7 @@ mod gro { /// Returns whether the given socket option is supported on the current platform /// /// Yields `Ok(true)` if the option was set successfully, `Ok(false)` if setting -/// the option raised an `ENOPROTOOPT` error, and `Err` for any other error. +/// the option raised an `ENOPROTOOPT` or `EOPNOTSUPP` error, and `Err` for any other error. fn set_socket_option_supported( socket: &impl AsRawFd, level: libc::c_int, @@ -1028,6 +1028,7 @@ fn set_socket_option_supported( match set_socket_option(socket, level, name, value) { Ok(()) => Ok(true), Err(err) if err.raw_os_error() == Some(libc::ENOPROTOOPT) => Ok(false), + Err(err) if err.raw_os_error() == Some(libc::EOPNOTSUPP) => Ok(false), Err(err) => Err(err), } }