aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/cls_basic.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/cls_basic.c')
-rw-r--r--net/sched/cls_basic.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c
index 4a91f082a81d..c885412d79d5 100644
--- a/net/sched/cls_basic.c
+++ b/net/sched/cls_basic.c
@@ -17,6 +17,7 @@
17#include <linux/errno.h> 17#include <linux/errno.h>
18#include <linux/rtnetlink.h> 18#include <linux/rtnetlink.h>
19#include <linux/skbuff.h> 19#include <linux/skbuff.h>
20#include <net/netlink.h>
20#include <net/act_api.h> 21#include <net/act_api.h>
21#include <net/pkt_cls.h> 22#include <net/pkt_cls.h>
22 23
@@ -245,7 +246,7 @@ static int basic_dump(struct tcf_proto *tp, unsigned long fh,
245 struct sk_buff *skb, struct tcmsg *t) 246 struct sk_buff *skb, struct tcmsg *t)
246{ 247{
247 struct basic_filter *f = (struct basic_filter *) fh; 248 struct basic_filter *f = (struct basic_filter *) fh;
248 unsigned char *b = skb->tail; 249 unsigned char *b = skb_tail_pointer(skb);
249 struct rtattr *rta; 250 struct rtattr *rta;
250 251
251 if (f == NULL) 252 if (f == NULL)
@@ -263,11 +264,11 @@ static int basic_dump(struct tcf_proto *tp, unsigned long fh,
263 tcf_em_tree_dump(skb, &f->ematches, TCA_BASIC_EMATCHES) < 0) 264 tcf_em_tree_dump(skb, &f->ematches, TCA_BASIC_EMATCHES) < 0)
264 goto rtattr_failure; 265 goto rtattr_failure;
265 266
266 rta->rta_len = (skb->tail - b); 267 rta->rta_len = skb_tail_pointer(skb) - b;
267 return skb->len; 268 return skb->len;
268 269
269rtattr_failure: 270rtattr_failure:
270 skb_trim(skb, b - skb->data); 271 nlmsg_trim(skb, b);
271 return -1; 272 return -1;
272} 273}
273 274