classifier: don't bail on qdisc_add_clsact error

pull/28/head
Dmitry Savintsev 3 years ago committed by GitHub
parent 581dc3908a
commit 4d22913931
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -111,7 +111,9 @@ async fn main() -> Result<(), anyhow::Error> {
program.attach(&opt.iface, XdpFlags::default())
.context("failed to attach the XDP program with default flags - try changing XdpFlags::default() to XdpFlags::SKB_MODE")?;
{%- when "classifier" -%}
tc::qdisc_add_clsact(&opt.iface)?;
// error adding clsact to the interface if it is already added is harmless
// the full cleanup can be done with 'sudo tc qdisc del dev eth0 clsact'.
let _ = tc::qdisc_add_clsact(&opt.iface);
let program: &mut SchedClassifier = bpf.program_mut("{{crate_name}}").unwrap().try_into()?;
program.load()?;
program.attach(&opt.iface, TcAttachType::{{direction}})?;

Loading…
Cancel
Save