mirror of
https://github.com/n0-computer/noq.git
synced 2026-09-21 02:33:23 +00:00
Catch EOPNOTSUPP as failure for opportunistic flags
This commit is contained in:
committed by
Benjamin Saunders
parent
78a5a6a884
commit
2fbb2ddd1c
@@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user