aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/cls_tcindex.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/cls_tcindex.c')
-rw-r--r--net/sched/cls_tcindex.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c
index 7563fdcef4b7..47ac0c556429 100644
--- a/net/sched/cls_tcindex.c
+++ b/net/sched/cls_tcindex.c
@@ -12,6 +12,7 @@
12#include <linux/netdevice.h> 12#include <linux/netdevice.h>
13#include <net/ip.h> 13#include <net/ip.h>
14#include <net/act_api.h> 14#include <net/act_api.h>
15#include <net/netlink.h>
15#include <net/pkt_cls.h> 16#include <net/pkt_cls.h>
16#include <net/route.h> 17#include <net/route.h>
17 18
@@ -448,7 +449,7 @@ static int tcindex_dump(struct tcf_proto *tp, unsigned long fh,
448{ 449{
449 struct tcindex_data *p = PRIV(tp); 450 struct tcindex_data *p = PRIV(tp);
450 struct tcindex_filter_result *r = (struct tcindex_filter_result *) fh; 451 struct tcindex_filter_result *r = (struct tcindex_filter_result *) fh;
451 unsigned char *b = skb->tail; 452 unsigned char *b = skb_tail_pointer(skb);
452 struct rtattr *rta; 453 struct rtattr *rta;
453 454
454 DPRINTK("tcindex_dump(tp %p,fh 0x%lx,skb %p,t %p),p %p,r %p,b %p\n", 455 DPRINTK("tcindex_dump(tp %p,fh 0x%lx,skb %p,t %p),p %p,r %p,b %p\n",
@@ -463,7 +464,7 @@ static int tcindex_dump(struct tcf_proto *tp, unsigned long fh,
463 RTA_PUT(skb,TCA_TCINDEX_SHIFT,sizeof(p->shift),&p->shift); 464 RTA_PUT(skb,TCA_TCINDEX_SHIFT,sizeof(p->shift),&p->shift);
464 RTA_PUT(skb,TCA_TCINDEX_FALL_THROUGH,sizeof(p->fall_through), 465 RTA_PUT(skb,TCA_TCINDEX_FALL_THROUGH,sizeof(p->fall_through),
465 &p->fall_through); 466 &p->fall_through);
466 rta->rta_len = skb->tail-b; 467 rta->rta_len = skb_tail_pointer(skb) - b;
467 } else { 468 } else {
468 if (p->perfect) { 469 if (p->perfect) {
469 t->tcm_handle = r-p->perfect; 470 t->tcm_handle = r-p->perfect;
@@ -486,7 +487,7 @@ static int tcindex_dump(struct tcf_proto *tp, unsigned long fh,
486 487
487 if (tcf_exts_dump(skb, &r->exts, &tcindex_ext_map) < 0) 488 if (tcf_exts_dump(skb, &r->exts, &tcindex_ext_map) < 0)
488 goto rtattr_failure; 489 goto rtattr_failure;
489 rta->rta_len = skb->tail-b; 490 rta->rta_len = skb_tail_pointer(skb) - b;
490 491
491 if (tcf_exts_dump_stats(skb, &r->exts, &tcindex_ext_map) < 0) 492 if (tcf_exts_dump_stats(skb, &r->exts, &tcindex_ext_map) < 0)
492 goto rtattr_failure; 493 goto rtattr_failure;
@@ -495,7 +496,7 @@ static int tcindex_dump(struct tcf_proto *tp, unsigned long fh,
495 return skb->len; 496 return skb->len;
496 497
497rtattr_failure: 498rtattr_failure:
498 skb_trim(skb, b - skb->data); 499 nlmsg_trim(skb, b);
499 return -1; 500 return -1;
500} 501}
501 502