[U32] Fix missing class/flowid oddity
When an action or policer is specified but not a classid/flowid, the
syntax accepts it but the kernel never really hits it.
This has been a long standing problem, but thanks to the persistence
of Marco Berizzi <pupilla@hotmail.com> I broke down and fixed it.
Signed-off-by: J Hadi Salim <hadi@cyberus.ca>
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
} sel;
struct tcmsg *t = NLMSG_DATA(n);
struct rtattr *tail;
- int sel_ok = 0;
+ int sel_ok = 0, terminal_ok = 0;
int sample_ok = 0;
__u32 htid = 0;
__u32 order = 0;
fprintf(stderr, "Illegal \"action\"\n");
return -1;
}
+ terminal_ok++;
continue;
} else if (matches(*argv, "police") == 0) {
fprintf(stderr, "Illegal \"police\"\n");
return -1;
}
+ terminal_ok++;
continue;
} else if (strcmp(*argv, "help") == 0) {
explain();
argc--; argv++;
}
+ /* We dont necessarily need class/flowids */
+ if (terminal_ok)
+ sel.sel.flags |= TC_U32_TERMINAL;
+
if (order) {
if (TC_U32_NODE(t->tcm_handle) && order != TC_U32_NODE(t->tcm_handle)) {
fprintf(stderr, "\"order\" contradicts \"handle\"\n");