Skip to contentSkip to conversation

Fix missing class/flowid oddity

PATCH New jamal 1 participant 1 message Dec 7, 2006

Subsystems (2)
lore
Share & tools
lore

jamal

author
#0 lore raw

PATCH 1/1 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 <[email protected]> I broke down and fixed it.

---
commit e2d2d34581e80363dfa29095e9e61d75f52963a1
tree fae21f558b325de873caf5d0559694063cd2b3c3
parent 32d6a748acb678ab4acb0c21844a0b03475baca1
author Jamal Hadi Salim <[email protected]> Thu, 07 Dec 2006 09:02:11 -0500 committer Jamal Hadi Salim <[email protected]> Thu, 07 Dec 2006 09:02:11 -0500

 tc/f_u32.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
tc/f_u32.c +7 -1
index aa83ba0..fe31ec0 100644
@@ -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");