netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jamal <hadi@cyberus.ca>
To: Stephen Hemminger <shemminger@vyatta.com>
Cc: Patrick McHardy <kaber@trash.net>, netdev@vger.kernel.org
Subject: [PATCH 2/3] [TC/FILTERS] Expose the filter protocol
Date: Sun, 20 Apr 2008 10:47:48 -0400	[thread overview]
Message-ID: <1208702868.12249.54.camel@localhost> (raw)

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


makes protocol accessible ..

cheers,
jamal

[-- Attachment #2: 0002-TC-FILTERS-Expose-the-filter-protocol.txt --]
[-- Type: text/plain, Size: 1550 bytes --]

[PATCH 2/3] [TC/FILTERS] Expose the filter protocol

Expose the filter protocol so it can be used by underlying
classifiers when they need it.

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
---
 tc/tc_filter.c |    9 +++++----
 tc/tc_util.h   |    1 +
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/tc/tc_filter.c b/tc/tc_filter.c
index 6701f9a..db44dec 100644
--- a/tc/tc_filter.c
+++ b/tc/tc_filter.c
@@ -175,6 +175,7 @@ static __u32 filter_parent;
 static int filter_ifindex;
 static __u32 filter_prio;
 static __u32 filter_protocol;
+__u16 f_proto = 0;
 
 int print_filter(const struct sockaddr_nl *who,
 			struct nlmsghdr *n,
@@ -221,13 +222,13 @@ int print_filter(const struct sockaddr_nl *who,
 		}
 	}
 	if (t->tcm_info) {
-		__u32 protocol = TC_H_MIN(t->tcm_info);
+		f_proto = TC_H_MIN(t->tcm_info);
 		__u32 prio = TC_H_MAJ(t->tcm_info)>>16;
-		if (!filter_protocol || filter_protocol != protocol) {
-			if (protocol) {
+		if (!filter_protocol || filter_protocol != f_proto) {
+			if (f_proto) {
 				SPRINT_BUF(b1);
 				fprintf(fp, "protocol %s ",
-					ll_proto_n2a(protocol, b1, sizeof(b1)));
+					ll_proto_n2a(f_proto, b1, sizeof(b1)));
 			}
 		}
 		if (!filter_prio || filter_prio != prio) {
diff --git a/tc/tc_util.h b/tc/tc_util.h
index 301b5c7..796da54 100644
--- a/tc/tc_util.h
+++ b/tc/tc_util.h
@@ -19,6 +19,7 @@ struct qdisc_util
 	int	(*print_copt)(struct qdisc_util *qu, FILE *f, struct rtattr *opt);
 };
 
+extern __u16 f_proto;
 struct filter_util
 {
 	struct filter_util *next;
-- 
1.4.4.1.gaed4


                 reply	other threads:[~2008-04-20 14:47 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=1208702868.12249.54.camel@localhost \
    --to=hadi@cyberus.ca \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).