Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/network/core_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,18 @@ impl CoreUtils {
}
Err(e) => return Err(e),
}
ctl.set_value_string(val)
let result = ctl.set_value_string(val);
// if we have a read only /proc we ignore it as well
match result {
Ok(_) => result,
Err(SysctlError::IoError(e)) => {
if e.raw_os_error() == Some(libc::EROFS) {
return Ok(String::from(""));
}
return Err(e.into());
},
Err(err) => return Err(err),
}
}
}

Expand Down Expand Up @@ -433,9 +444,6 @@ pub fn disable_ipv6_autoconf(if_name: &str) -> NetavarkResult<()> {
// just ignore that case
}

// if we have a read only /proc we ignore it as well
SysctlError::IoError(ref e) if e.raw_os_error() == Some(libc::EROFS) => {}

_ => {
return Err(NetavarkError::wrap(
"failed to set autoconf sysctl",
Expand Down