All of lore.kernel.org
 help / color / mirror / Atom feed
From: jamal <hadi@cyberus.ca>
To: Stephen Hemminger <shemminger@osdl.org>
Cc: Marco Berizzi <pupilla@hotmail.com>, netdev@vger.kernel.org
Subject: [IPROUTE2 PATCH][U32] Fix missing class/flowid oddity
Date: Thu, 07 Dec 2006 11:07:07 -0500	[thread overview]
Message-ID: <1165507627.3739.25.camel@localhost> (raw)

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: ipr-fact1 --]
[-- Type: text/plain, Size: 1998 bytes --]

[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>

---
commit e2d2d34581e80363dfa29095e9e61d75f52963a1
tree fae21f558b325de873caf5d0559694063cd2b3c3
parent 32d6a748acb678ab4acb0c21844a0b03475baca1
author Jamal Hadi Salim <hadi@cyberus.ca> Thu, 07 Dec 2006 09:02:11 -0500
committer Jamal Hadi Salim <hadi@cyberus.ca> Thu, 07 Dec 2006 09:02:11 -0500

 tc/f_u32.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/tc/f_u32.c b/tc/f_u32.c
index aa83ba0..fe31ec0 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");

                 reply	other threads:[~2006-12-07 16:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1165507627.3739.25.camel@localhost \
    --to=hadi@cyberus.ca \
    --cc=netdev@vger.kernel.org \
    --cc=pupilla@hotmail.com \
    --cc=shemminger@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.