Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
[powerpc.git] / net / sched / cls_fw.c
index e54acc6..bbec4a0 100644 (file)
@@ -24,7 +24,6 @@
 #include <linux/bitops.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
-#include <linux/sched.h>
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/socket.h>
@@ -39,6 +38,7 @@
 #include <linux/notifier.h>
 #include <linux/netfilter.h>
 #include <net/ip.h>
+#include <net/netlink.h>
 #include <net/route.h>
 #include <linux/skbuff.h>
 #include <net/sock.h>
@@ -91,7 +91,7 @@ static __inline__ int fw_hash(u32 handle)
        else if (HTSIZE == 256) {
                u8 *t = (u8 *) &handle;
                return t[0] ^ t[1] ^ t[2] ^ t[3];
-       } else 
+       } else
                return handle & (HTSIZE - 1);
 }
 
@@ -101,13 +101,10 @@ static int fw_classify(struct sk_buff *skb, struct tcf_proto *tp,
        struct fw_head *head = (struct fw_head*)tp->root;
        struct fw_filter *f;
        int r;
-#ifdef CONFIG_NETFILTER
-       u32 id = skb->nfmark & head->mask;
-#else
-       u32 id = 0;
-#endif
+       u32 id = skb->mark;
 
        if (head != NULL) {
+               id &= head->mask;
                for (f=head->ht[fw_hash(id)]; f; f=f->next) {
                        if (f->id == id) {
                                *res = f->res;
@@ -352,7 +349,7 @@ static int fw_dump(struct tcf_proto *tp, unsigned long fh,
 {
        struct fw_head *head = (struct fw_head *)tp->root;
        struct fw_filter *f = (struct fw_filter*)fh;
-       unsigned char    *b = skb->tail;
+       unsigned char *b = skb_tail_pointer(skb);
        struct rtattr *rta;
 
        if (f == NULL)
@@ -378,7 +375,7 @@ static int fw_dump(struct tcf_proto *tp, unsigned long fh,
        if (tcf_exts_dump(skb, &f->exts, &fw_ext_map) < 0)
                goto rtattr_failure;
 
-       rta->rta_len = skb->tail - b;
+       rta->rta_len = skb_tail_pointer(skb) - b;
 
        if (tcf_exts_dump_stats(skb, &f->exts, &fw_ext_map) < 0)
                goto rtattr_failure;
@@ -386,7 +383,7 @@ static int fw_dump(struct tcf_proto *tp, unsigned long fh,
        return skb->len;
 
 rtattr_failure:
-       skb_trim(skb, b - skb->data);
+       nlmsg_trim(skb, b);
        return -1;
 }
 
@@ -410,7 +407,7 @@ static int __init init_fw(void)
        return register_tcf_proto_ops(&cls_fw_ops);
 }
 
-static void __exit exit_fw(void) 
+static void __exit exit_fw(void)
 {
        unregister_tcf_proto_ops(&cls_fw_ops);
 }