]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - net/sched/cls_tcindex.c
[NET_SCHED]: Remove unnecessary includes
[mv-sheeva.git] / net / sched / cls_tcindex.c
index 5af8a59e1503c7d5a90cf332af72ee5921d94950..2314820a080a3d7e94b4e523c1dc242ce1c493b7 100644 (file)
@@ -9,11 +9,9 @@
 #include <linux/kernel.h>
 #include <linux/skbuff.h>
 #include <linux/errno.h>
-#include <linux/netdevice.h>
-#include <net/ip.h>
 #include <net/act_api.h>
+#include <net/netlink.h>
 #include <net/pkt_cls.h>
-#include <net/route.h>
 
 
 /*
@@ -222,7 +220,7 @@ tcindex_set_parms(struct tcf_proto *tp, unsigned long base, u32 handle,
        err = tcf_exts_validate(tp, tb, est, &e, &tcindex_ext_map);
        if (err < 0)
                return err;
-       
+
        memcpy(&cp, p, sizeof(cp));
        memset(&new_filter_result, 0, sizeof(new_filter_result));
 
@@ -245,9 +243,9 @@ tcindex_set_parms(struct tcf_proto *tp, unsigned long base, u32 handle,
        }
 
        if (tb[TCA_TCINDEX_SHIFT-1]) {
-               if (RTA_PAYLOAD(tb[TCA_TCINDEX_SHIFT-1]) < sizeof(u16))
+               if (RTA_PAYLOAD(tb[TCA_TCINDEX_SHIFT-1]) < sizeof(int))
                        goto errout;
-               cp.shift = *(u16 *) RTA_DATA(tb[TCA_TCINDEX_SHIFT-1]);
+               cp.shift = *(int *) RTA_DATA(tb[TCA_TCINDEX_SHIFT-1]);
        }
 
        err = -EBUSY;
@@ -316,12 +314,12 @@ tcindex_set_parms(struct tcf_proto *tp, unsigned long base, u32 handle,
                f = kzalloc(sizeof(*f), GFP_KERNEL);
                if (!f)
                        goto errout_alloc;
-       }
+       }
 
        if (tb[TCA_TCINDEX_CLASSID-1]) {
                cr.res.classid = *(u32 *) RTA_DATA(tb[TCA_TCINDEX_CLASSID-1]);
                tcf_bind_filter(tp, &cr.res, base);
-       }
+       }
 
        tcf_exts_change(tp, &cr.exts, &e);
 
@@ -341,7 +339,7 @@ tcindex_set_parms(struct tcf_proto *tp, unsigned long base, u32 handle,
                for (fp = p->h+(handle % p->hash); *fp; fp = &(*fp)->next)
                        /* nothing */;
                *fp = f;
-       }
+       }
        tcf_tree_unlock(tp);
 
        return 0;
@@ -448,7 +446,7 @@ static int tcindex_dump(struct tcf_proto *tp, unsigned long fh,
 {
        struct tcindex_data *p = PRIV(tp);
        struct tcindex_filter_result *r = (struct tcindex_filter_result *) fh;
-       unsigned char *b = skb->tail;
+       unsigned char *b = skb_tail_pointer(skb);
        struct rtattr *rta;
 
        DPRINTK("tcindex_dump(tp %p,fh 0x%lx,skb %p,t %p),p %p,r %p,b %p\n",
@@ -463,7 +461,7 @@ static int tcindex_dump(struct tcf_proto *tp, unsigned long fh,
                RTA_PUT(skb,TCA_TCINDEX_SHIFT,sizeof(p->shift),&p->shift);
                RTA_PUT(skb,TCA_TCINDEX_FALL_THROUGH,sizeof(p->fall_through),
                    &p->fall_through);
-               rta->rta_len = skb->tail-b;
+               rta->rta_len = skb_tail_pointer(skb) - b;
        } else {
                if (p->perfect) {
                        t->tcm_handle = r-p->perfect;
@@ -486,16 +484,16 @@ static int tcindex_dump(struct tcf_proto *tp, unsigned long fh,
 
                if (tcf_exts_dump(skb, &r->exts, &tcindex_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, &r->exts, &tcindex_ext_map) < 0)
                        goto rtattr_failure;
        }
-       
+
        return skb->len;
 
 rtattr_failure:
-       skb_trim(skb, b - skb->data);
+       nlmsg_trim(skb, b);
        return -1;
 }
 
@@ -519,7 +517,7 @@ static int __init init_tcindex(void)
        return register_tcf_proto_ops(&cls_tcindex_ops);
 }
 
-static void __exit exit_tcindex(void) 
+static void __exit exit_tcindex(void)
 {
        unregister_tcf_proto_ops(&cls_tcindex_ops);
 }