]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
Expose the filter protocol
authorjamal <hadi@cyberus.ca>
Sun, 20 Apr 2008 14:47:48 +0000 (10:47 -0400)
committerStephen Hemminger <stephen.hemminger@vyatta.com>
Fri, 9 May 2008 22:44:46 +0000 (15:44 -0700)
makes protocol accessible ..

cheers,
jamal

[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
tc/tc_util.h

index 6701f9ae28981f0c8186e0ef06255a8180ed0a07..db44dec422d2d02dff580c4e1e368d5ffbb2fe03 100644 (file)
@@ -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) {
index 301b5c7ff7ceb1c71ac776188bc4309e4719592b..796da5427877069c8aa1d8b0d3d60d5347687fa0 100644 (file)
@@ -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;