From: jamal Date: Thu, 7 Dec 2006 16:07:07 +0000 (-0500) Subject: Fix missing class/flowid oddity X-Git-Tag: v2.6.19-061214~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dcf13497228742af3290ce6039e821d9c5ed5945;p=thirdparty%2Fiproute2.git Fix missing class/flowid oddity [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 I broke down and fixed it. Signed-off-by: J Hadi Salim Signed-off-by: Stephen Hemminger --- diff --git a/tc/f_u32.c b/tc/f_u32.c index aa83ba081..fe31ec085 100644 --- a/tc/f_u32.c +++ b/tc/f_u32.c @@ -779,7 +779,7 @@ static int u32_parse_opt(struct filter_util *qu, char *handle, int argc, char ** } 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; @@ -924,6 +924,7 @@ static int u32_parse_opt(struct filter_util *qu, char *handle, int argc, char ** fprintf(stderr, "Illegal \"action\"\n"); return -1; } + terminal_ok++; continue; } else if (matches(*argv, "police") == 0) { @@ -932,6 +933,7 @@ static int u32_parse_opt(struct filter_util *qu, char *handle, int argc, char ** fprintf(stderr, "Illegal \"police\"\n"); return -1; } + terminal_ok++; continue; } else if (strcmp(*argv, "help") == 0) { explain(); @@ -944,6 +946,10 @@ static int u32_parse_opt(struct filter_util *qu, char *handle, int argc, char ** 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");