aya: tc: make qdisc_add_clsact return io::Error

pull/25/head
Alessandro Decina 3 years ago
parent 35e9b4e639
commit 9c8e78b7d4

@ -161,11 +161,7 @@ impl Link for TcLink {
/// ///
/// The `clsact` qdisc must be added to an interface before [`SchedClassifier`] /// The `clsact` qdisc must be added to an interface before [`SchedClassifier`]
/// programs can be attached. /// programs can be attached.
pub fn qdisc_add_clsact(if_name: &str) -> Result<(), ProgramError> { pub fn qdisc_add_clsact(if_name: &str) -> Result<(), io::Error> {
let if_index = ifindex_from_ifname(if_name).map_err(|_| ProgramError::UnknownInterface { let if_index = ifindex_from_ifname(if_name)?;
name: if_name.to_string(),
})?;
unsafe { netlink_qdisc_add_clsact(if_index as i32) } unsafe { netlink_qdisc_add_clsact(if_index as i32) }
.map_err(|io_error| TcError::NetlinkError { io_error })?;
Ok(())
} }

Loading…
Cancel
Save