Merge pull request #28 from dmitris/patch-1

classifier: don't bail on qdisc_add_clsact error
pull/29/head
Alessandro Decina 3 years ago committed by GitHub
commit 1a24fea5fe
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