From fd74179fbbc3ea1190d80ee82648461884d14030 Mon Sep 17 00:00:00 2001 From: Tim Niemeyer Date: Mon, 2 Apr 2018 18:32:04 +0200 Subject: [PATCH] tc: use rel path for tc --- tc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tc.c b/tc.c index c3a8004..6f266d7 100644 --- a/tc.c +++ b/tc.c @@ -31,7 +31,7 @@ extern const char *g_interface; void tc_add_qdisc_ingress() { char cmd[2048]; - snprintf(cmd, 2048, "/sbin/tc qdisc add dev %s ingress", g_interface); + snprintf(cmd, 2048, "tc qdisc add dev %s ingress", g_interface); log_debug("CMD: %s\n", cmd); system(cmd); } @@ -39,7 +39,7 @@ void tc_add_qdisc_ingress() void tc_del_qdisc_ingress() { char cmd[2048]; - snprintf(cmd, 2048, "/sbin/tc qdisc del dev %s ingress", g_interface); + snprintf(cmd, 2048, "tc qdisc del dev %s ingress", g_interface); log_debug("CMD: %s\n", cmd); system(cmd); } @@ -47,7 +47,7 @@ void tc_del_qdisc_ingress() void tc_block_all() { char cmd[2048]; - snprintf(cmd, 2048, "/sbin/tc filter add dev %s protocol all parent ffff: prio 65535 basic match \"u32(u16 0x4305 0xffff at -2)\" flowid :1 action drop", g_interface); + snprintf(cmd, 2048, "tc filter add dev %s protocol all parent ffff: prio 65535 basic match \"u32(u16 0x4305 0xffff at -2)\" flowid :1 action drop", g_interface); log_debug("CMD: %s\n", cmd); system(cmd); } @@ -55,7 +55,7 @@ void tc_block_all() void tc_allow_mac(const uint8_t mac[]) { char cmd[2048]; - snprintf(cmd, 2048, "/sbin/tc filter add dev %s protocol all parent ffff: prio 99 " + snprintf(cmd, 2048, "tc filter add dev %s protocol all parent ffff: prio 99 " "basic match \"u32(u32 0x%2x%2x%2x%2x 0xffffffff at -8)\" " "and \"u32(u16 0x%2x%2x 0xffff at -4)\" flowid :1 action pass", g_interface, mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); @@ -66,7 +66,7 @@ void tc_allow_mac(const uint8_t mac[]) void tc_disallow_mac(const uint8_t mac[]) { char cmd[2048]; - snprintf(cmd, 2048, "/sbin/tc filter delete dev %s protocol all parent ffff: prio 99 " + snprintf(cmd, 2048, "tc filter delete dev %s protocol all parent ffff: prio 99 " "basic match \"u32(u32 0x%2x%2x%2x%2x 0xffffffff at -8)\" " "and \"u32(u16 0x%2x%2x 0xffff at -4)\" flowid :1 action pass", g_interface, mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);