From 9c8e78b7d4192b376ec2e532d9ddcf81c3c5182e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alessandro=C2=A0Decina?= Date: Mon, 28 Jun 2021 10:41:26 +0000 Subject: [PATCH] aya: tc: make qdisc_add_clsact return io::Error --- aya/src/programs/tc.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/aya/src/programs/tc.rs b/aya/src/programs/tc.rs index 6847a68e..42547273 100644 --- a/aya/src/programs/tc.rs +++ b/aya/src/programs/tc.rs @@ -161,11 +161,7 @@ impl Link for TcLink { /// /// The `clsact` qdisc must be added to an interface before [`SchedClassifier`] /// programs can be attached. -pub fn qdisc_add_clsact(if_name: &str) -> Result<(), ProgramError> { - let if_index = ifindex_from_ifname(if_name).map_err(|_| ProgramError::UnknownInterface { - name: if_name.to_string(), - })?; +pub fn qdisc_add_clsact(if_name: &str) -> Result<(), io::Error> { + let if_index = ifindex_from_ifname(if_name)?; unsafe { netlink_qdisc_add_clsact(if_index as i32) } - .map_err(|io_error| TcError::NetlinkError { io_error })?; - Ok(()) }