Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tc: Use correct mask for u32 matcher #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions tc.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ void tc_allow_mac(const uint8_t mac[], uint8_t prio)
snprintf(mac32, 9, "%02x%02x%02x%02x", mac[0], mac[1], mac[2], mac[3]);
snprintf(mac16, 5, "%02x%02x", mac[4], mac[5]);
snprintf(cmd, 2048, "tc filter add dev %s protocol all parent ffff: prio %d "
"basic match \"u32(u32 0x%s 0x%s at -8)\" "
"and \"u32(u16 0x%s 0x%s at -4)\" flowid :1 action pass",
g_interface, prio, mac32, mac32, mac16, mac16);
"basic match \"u32(u32 0x%s 0xffffffff at -8)\" "
"and \"u32(u16 0x%s 0xffff at -4)\" flowid :1 action pass",
g_interface, prio, mac32, mac16);
log_trace("CMD: %s\n", cmd);
system(cmd);
}
Expand All @@ -75,9 +75,9 @@ void tc_disallow_mac(const uint8_t mac[], uint8_t prio)
snprintf(mac32, 9, "%02x%02x%02x%02x", mac[0], mac[1], mac[2], mac[3]);
snprintf(mac16, 5, "%02x%02x", mac[4], mac[5]);
snprintf(cmd, 2048, "tc filter delete dev %s protocol all parent ffff: prio %d "
"basic match \"u32(u32 0x%s 0x%s at -8)\" "
"and \"u32(u16 0x%s 0x%s at -4)\" flowid :1 action pass",
g_interface, prio, mac32, mac32, mac16, mac16);
"basic match \"u32(u32 0x%s 0xffffffff at -8)\" "
"and \"u32(u16 0x%s 0xffff at -4)\" flowid :1 action pass",
g_interface, prio, mac32, mac16);
log_trace("CMD: %s\n", cmd);
system(cmd);
}
Expand Down