aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-03-26 02:06:12 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:26:37 -0400
commitdc5fc579b90ed0a9a4e55b0218cdbaf0a8cf2e67 (patch)
tree673dbb425c2b09b4256ef71f89dfc5cc01944386 /net/sched
parenta36ca733375860b389c15ffdf6a5f92df64a33b6 (diff)
[NETLINK]: Use nlmsg_trim() where appropriate
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/act_api.c17
-rw-r--r--net/sched/act_gact.c3
-rw-r--r--net/sched/act_ipt.c3
-rw-r--r--net/sched/act_mirred.c3
-rw-r--r--net/sched/act_pedit.c3
-rw-r--r--net/sched/act_police.c9
-rw-r--r--net/sched/act_simple.c3
-rw-r--r--net/sched/cls_api.c4
-rw-r--r--net/sched/cls_basic.c3
-rw-r--r--net/sched/cls_fw.c3
-rw-r--r--net/sched/cls_route.c3
-rw-r--r--net/sched/cls_rsvp.c1
-rw-r--r--net/sched/cls_rsvp.h2
-rw-r--r--net/sched/cls_rsvp6.c1
-rw-r--r--net/sched/cls_tcindex.c3
-rw-r--r--net/sched/cls_u32.c3
-rw-r--r--net/sched/sch_api.c5
-rw-r--r--net/sched/sch_atm.c3
-rw-r--r--net/sched/sch_cbq.c17
-rw-r--r--net/sched/sch_hfsc.c5
-rw-r--r--net/sched/sch_htb.c5
-rw-r--r--net/sched/sch_ingress.c3
-rw-r--r--net/sched/sch_netem.c3
-rw-r--r--net/sched/sch_prio.c3
-rw-r--r--net/sched/sch_sfq.c3
-rw-r--r--net/sched/sch_tbf.c3
26 files changed, 70 insertions, 44 deletions
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 28326fb1fc4e..f002f74f3763 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -31,6 +31,7 @@
31#include <net/sock.h> 31#include <net/sock.h>
32#include <net/sch_generic.h> 32#include <net/sch_generic.h>
33#include <net/act_api.h> 33#include <net/act_api.h>
34#include <net/netlink.h>
34 35
35void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo) 36void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo)
36{ 37{
@@ -98,7 +99,7 @@ static int tcf_dump_walker(struct sk_buff *skb, struct netlink_callback *cb,
98 err = tcf_action_dump_1(skb, a, 0, 0); 99 err = tcf_action_dump_1(skb, a, 0, 0);
99 if (err < 0) { 100 if (err < 0) {
100 index--; 101 index--;
101 skb_trim(skb, (u8*)r - skb->data); 102 nlmsg_trim(skb, r);
102 goto done; 103 goto done;
103 } 104 }
104 r->rta_len = skb_tail_pointer(skb) - (u8 *)r; 105 r->rta_len = skb_tail_pointer(skb) - (u8 *)r;
@@ -114,7 +115,7 @@ done:
114 return n_i; 115 return n_i;
115 116
116rtattr_failure: 117rtattr_failure:
117 skb_trim(skb, (u8*)r - skb->data); 118 nlmsg_trim(skb, r);
118 goto done; 119 goto done;
119} 120}
120 121
@@ -144,7 +145,7 @@ static int tcf_del_walker(struct sk_buff *skb, struct tc_action *a,
144 145
145 return n_i; 146 return n_i;
146rtattr_failure: 147rtattr_failure:
147 skb_trim(skb, (u8*)r - skb->data); 148 nlmsg_trim(skb, r);
148 return -EINVAL; 149 return -EINVAL;
149} 150}
150 151
@@ -440,7 +441,7 @@ tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
440 } 441 }
441 442
442rtattr_failure: 443rtattr_failure:
443 skb_trim(skb, b - skb->data); 444 nlmsg_trim(skb, b);
444 return -1; 445 return -1;
445} 446}
446 447
@@ -467,7 +468,7 @@ tcf_action_dump(struct sk_buff *skb, struct tc_action *act, int bind, int ref)
467rtattr_failure: 468rtattr_failure:
468 err = -EINVAL; 469 err = -EINVAL;
469errout: 470errout:
470 skb_trim(skb, b - skb->data); 471 nlmsg_trim(skb, b);
471 return err; 472 return err;
472} 473}
473 474
@@ -658,7 +659,7 @@ tca_get_fill(struct sk_buff *skb, struct tc_action *a, u32 pid, u32 seq,
658 659
659rtattr_failure: 660rtattr_failure:
660nlmsg_failure: 661nlmsg_failure:
661 skb_trim(skb, b - skb->data); 662 nlmsg_trim(skb, b);
662 return -1; 663 return -1;
663} 664}
664 665
@@ -1059,7 +1060,7 @@ tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb)
1059 x->rta_len = skb_tail_pointer(skb) - (u8 *)x; 1060 x->rta_len = skb_tail_pointer(skb) - (u8 *)x;
1060 ret = skb->len; 1061 ret = skb->len;
1061 } else 1062 } else
1062 skb_trim(skb, (u8*)x - skb->data); 1063 nlmsg_trim(skb, x);
1063 1064
1064 nlh->nlmsg_len = skb_tail_pointer(skb) - b; 1065 nlh->nlmsg_len = skb_tail_pointer(skb) - b;
1065 if (NETLINK_CB(cb->skb).pid && ret) 1066 if (NETLINK_CB(cb->skb).pid && ret)
@@ -1070,7 +1071,7 @@ tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb)
1070rtattr_failure: 1071rtattr_failure:
1071nlmsg_failure: 1072nlmsg_failure:
1072 module_put(a_o->owner); 1073 module_put(a_o->owner);
1073 skb_trim(skb, b - skb->data); 1074 nlmsg_trim(skb, b);
1074 return skb->len; 1075 return skb->len;
1075} 1076}
1076 1077
diff --git a/net/sched/act_gact.c b/net/sched/act_gact.c
index aad748b3b38c..7517f3791541 100644
--- a/net/sched/act_gact.c
+++ b/net/sched/act_gact.c
@@ -28,6 +28,7 @@
28#include <linux/module.h> 28#include <linux/module.h>
29#include <linux/init.h> 29#include <linux/init.h>
30#include <linux/proc_fs.h> 30#include <linux/proc_fs.h>
31#include <net/netlink.h>
31#include <net/sock.h> 32#include <net/sock.h>
32#include <net/pkt_sched.h> 33#include <net/pkt_sched.h>
33#include <linux/tc_act/tc_gact.h> 34#include <linux/tc_act/tc_gact.h>
@@ -181,7 +182,7 @@ static int tcf_gact_dump(struct sk_buff *skb, struct tc_action *a, int bind, int
181 return skb->len; 182 return skb->len;
182 183
183rtattr_failure: 184rtattr_failure:
184 skb_trim(skb, b - skb->data); 185 nlmsg_trim(skb, b);
185 return -1; 186 return -1;
186} 187}
187 188
diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c
index 2ccfd5b20fab..00b05f422d45 100644
--- a/net/sched/act_ipt.c
+++ b/net/sched/act_ipt.c
@@ -30,6 +30,7 @@
30#include <linux/init.h> 30#include <linux/init.h>
31#include <linux/proc_fs.h> 31#include <linux/proc_fs.h>
32#include <linux/kmod.h> 32#include <linux/kmod.h>
33#include <net/netlink.h>
33#include <net/sock.h> 34#include <net/sock.h>
34#include <net/pkt_sched.h> 35#include <net/pkt_sched.h>
35#include <linux/tc_act/tc_ipt.h> 36#include <linux/tc_act/tc_ipt.h>
@@ -277,7 +278,7 @@ static int tcf_ipt_dump(struct sk_buff *skb, struct tc_action *a, int bind, int
277 return skb->len; 278 return skb->len;
278 279
279rtattr_failure: 280rtattr_failure:
280 skb_trim(skb, b - skb->data); 281 nlmsg_trim(skb, b);
281 kfree(t); 282 kfree(t);
282 return -1; 283 return -1;
283} 284}
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index 15f6ecdaf611..de21c92faaa2 100644
--- a/net/sched/act_mirred.c
+++ b/net/sched/act_mirred.c
@@ -30,6 +30,7 @@
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/init.h> 31#include <linux/init.h>
32#include <linux/proc_fs.h> 32#include <linux/proc_fs.h>
33#include <net/netlink.h>
33#include <net/sock.h> 34#include <net/sock.h>
34#include <net/pkt_sched.h> 35#include <net/pkt_sched.h>
35#include <linux/tc_act/tc_mirred.h> 36#include <linux/tc_act/tc_mirred.h>
@@ -225,7 +226,7 @@ static int tcf_mirred_dump(struct sk_buff *skb, struct tc_action *a, int bind, i
225 return skb->len; 226 return skb->len;
226 227
227rtattr_failure: 228rtattr_failure:
228 skb_trim(skb, b - skb->data); 229 nlmsg_trim(skb, b);
229 return -1; 230 return -1;
230} 231}
231 232
diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c
index d654cea1a46c..45b3cda86a21 100644
--- a/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -27,6 +27,7 @@
27#include <linux/module.h> 27#include <linux/module.h>
28#include <linux/init.h> 28#include <linux/init.h>
29#include <linux/proc_fs.h> 29#include <linux/proc_fs.h>
30#include <net/netlink.h>
30#include <net/sock.h> 31#include <net/sock.h>
31#include <net/pkt_sched.h> 32#include <net/pkt_sched.h>
32#include <linux/tc_act/tc_pedit.h> 33#include <linux/tc_act/tc_pedit.h>
@@ -226,7 +227,7 @@ static int tcf_pedit_dump(struct sk_buff *skb, struct tc_action *a,
226 return skb->len; 227 return skb->len;
227 228
228rtattr_failure: 229rtattr_failure:
229 skb_trim(skb, b - skb->data); 230 nlmsg_trim(skb, b);
230 kfree(opt); 231 kfree(opt);
231 return -1; 232 return -1;
232} 233}
diff --git a/net/sched/act_police.c b/net/sched/act_police.c
index 068b23763665..0a5679ea6c64 100644
--- a/net/sched/act_police.c
+++ b/net/sched/act_police.c
@@ -30,6 +30,7 @@
30#include <linux/init.h> 30#include <linux/init.h>
31#include <net/sock.h> 31#include <net/sock.h>
32#include <net/act_api.h> 32#include <net/act_api.h>
33#include <net/netlink.h>
33 34
34#define L2T(p,L) ((p)->tcfp_R_tab->data[(L)>>(p)->tcfp_R_tab->rate.cell_log]) 35#define L2T(p,L) ((p)->tcfp_R_tab->data[(L)>>(p)->tcfp_R_tab->rate.cell_log])
35#define L2T_P(p,L) ((p)->tcfp_P_tab->data[(L)>>(p)->tcfp_P_tab->rate.cell_log]) 36#define L2T_P(p,L) ((p)->tcfp_P_tab->data[(L)>>(p)->tcfp_P_tab->rate.cell_log])
@@ -88,7 +89,7 @@ static int tcf_act_police_walker(struct sk_buff *skb, struct netlink_callback *c
88 err = tcf_action_dump_1(skb, a, 0, 0); 89 err = tcf_action_dump_1(skb, a, 0, 0);
89 if (err < 0) { 90 if (err < 0) {
90 index--; 91 index--;
91 skb_trim(skb, (u8*)r - skb->data); 92 nlmsg_trim(skb, r);
92 goto done; 93 goto done;
93 } 94 }
94 r->rta_len = skb_tail_pointer(skb) - (u8 *)r; 95 r->rta_len = skb_tail_pointer(skb) - (u8 *)r;
@@ -102,7 +103,7 @@ done:
102 return n_i; 103 return n_i;
103 104
104rtattr_failure: 105rtattr_failure:
105 skb_trim(skb, (u8*)r - skb->data); 106 nlmsg_trim(skb, r);
106 goto done; 107 goto done;
107} 108}
108#endif 109#endif
@@ -355,7 +356,7 @@ tcf_act_police_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
355 return skb->len; 356 return skb->len;
356 357
357rtattr_failure: 358rtattr_failure:
358 skb_trim(skb, b - skb->data); 359 nlmsg_trim(skb, b);
359 return -1; 360 return -1;
360} 361}
361 362
@@ -598,7 +599,7 @@ int tcf_police_dump(struct sk_buff *skb, struct tcf_police *police)
598 return skb->len; 599 return skb->len;
599 600
600rtattr_failure: 601rtattr_failure:
601 skb_trim(skb, b - skb->data); 602 nlmsg_trim(skb, b);
602 return -1; 603 return -1;
603} 604}
604 605
diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c
index ecbcfa59b76c..36e1edad5990 100644
--- a/net/sched/act_simple.c
+++ b/net/sched/act_simple.c
@@ -16,6 +16,7 @@
16#include <linux/netdevice.h> 16#include <linux/netdevice.h>
17#include <linux/skbuff.h> 17#include <linux/skbuff.h>
18#include <linux/rtnetlink.h> 18#include <linux/rtnetlink.h>
19#include <net/netlink.h>
19#include <net/pkt_sched.h> 20#include <net/pkt_sched.h>
20 21
21#define TCA_ACT_SIMP 22 22#define TCA_ACT_SIMP 22
@@ -173,7 +174,7 @@ static inline int tcf_simp_dump(struct sk_buff *skb, struct tc_action *a,
173 return skb->len; 174 return skb->len;
174 175
175rtattr_failure: 176rtattr_failure:
176 skb_trim(skb, b - skb->data); 177 nlmsg_trim(skb, b);
177 return -1; 178 return -1;
178} 179}
179 180
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 84231baf77d1..3d0a6cdcaebc 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -32,6 +32,8 @@
32#include <linux/rtnetlink.h> 32#include <linux/rtnetlink.h>
33#include <linux/init.h> 33#include <linux/init.h>
34#include <linux/kmod.h> 34#include <linux/kmod.h>
35#include <linux/netlink.h>
36#include <net/netlink.h>
35#include <net/sock.h> 37#include <net/sock.h>
36#include <net/pkt_sched.h> 38#include <net/pkt_sched.h>
37#include <net/pkt_cls.h> 39#include <net/pkt_cls.h>
@@ -345,7 +347,7 @@ tcf_fill_node(struct sk_buff *skb, struct tcf_proto *tp, unsigned long fh,
345 347
346nlmsg_failure: 348nlmsg_failure:
347rtattr_failure: 349rtattr_failure:
348 skb_trim(skb, b - skb->data); 350 nlmsg_trim(skb, b);
349 return -1; 351 return -1;
350} 352}
351 353
diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c
index 800ec2ac326b..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
@@ -267,7 +268,7 @@ static int basic_dump(struct tcf_proto *tp, unsigned long fh,
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
diff --git a/net/sched/cls_fw.c b/net/sched/cls_fw.c
index f5f355852a87..bbec4a0d4dcb 100644
--- a/net/sched/cls_fw.c
+++ b/net/sched/cls_fw.c
@@ -38,6 +38,7 @@
38#include <linux/notifier.h> 38#include <linux/notifier.h>
39#include <linux/netfilter.h> 39#include <linux/netfilter.h>
40#include <net/ip.h> 40#include <net/ip.h>
41#include <net/netlink.h>
41#include <net/route.h> 42#include <net/route.h>
42#include <linux/skbuff.h> 43#include <linux/skbuff.h>
43#include <net/sock.h> 44#include <net/sock.h>
@@ -382,7 +383,7 @@ static int fw_dump(struct tcf_proto *tp, unsigned long fh,
382 return skb->len; 383 return skb->len;
383 384
384rtattr_failure: 385rtattr_failure:
385 skb_trim(skb, b - skb->data); 386 nlmsg_trim(skb, b);
386 return -1; 387 return -1;
387} 388}
388 389
diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c
index 1f94df36239d..e92d716c9158 100644
--- a/net/sched/cls_route.c
+++ b/net/sched/cls_route.c
@@ -28,6 +28,7 @@
28#include <linux/etherdevice.h> 28#include <linux/etherdevice.h>
29#include <linux/notifier.h> 29#include <linux/notifier.h>
30#include <net/ip.h> 30#include <net/ip.h>
31#include <net/netlink.h>
31#include <net/route.h> 32#include <net/route.h>
32#include <linux/skbuff.h> 33#include <linux/skbuff.h>
33#include <net/sock.h> 34#include <net/sock.h>
@@ -599,7 +600,7 @@ static int route4_dump(struct tcf_proto *tp, unsigned long fh,
599 return skb->len; 600 return skb->len;
600 601
601rtattr_failure: 602rtattr_failure:
602 skb_trim(skb, b - skb->data); 603 nlmsg_trim(skb, b);
603 return -1; 604 return -1;
604} 605}
605 606
diff --git a/net/sched/cls_rsvp.c b/net/sched/cls_rsvp.c
index 1d4a1fb17608..0a683c07c648 100644
--- a/net/sched/cls_rsvp.c
+++ b/net/sched/cls_rsvp.c
@@ -31,6 +31,7 @@
31#include <net/route.h> 31#include <net/route.h>
32#include <linux/skbuff.h> 32#include <linux/skbuff.h>
33#include <net/sock.h> 33#include <net/sock.h>
34#include <net/netlink.h>
34#include <net/act_api.h> 35#include <net/act_api.h>
35#include <net/pkt_cls.h> 36#include <net/pkt_cls.h>
36 37
diff --git a/net/sched/cls_rsvp.h b/net/sched/cls_rsvp.h
index 87ed6f3c5070..22f9ede70e8f 100644
--- a/net/sched/cls_rsvp.h
+++ b/net/sched/cls_rsvp.h
@@ -630,7 +630,7 @@ static int rsvp_dump(struct tcf_proto *tp, unsigned long fh,
630 return skb->len; 630 return skb->len;
631 631
632rtattr_failure: 632rtattr_failure:
633 skb_trim(skb, b - skb->data); 633 nlmsg_trim(skb, b);
634 return -1; 634 return -1;
635} 635}
636 636
diff --git a/net/sched/cls_rsvp6.c b/net/sched/cls_rsvp6.c
index a2979d89798f..93b6abed57db 100644
--- a/net/sched/cls_rsvp6.c
+++ b/net/sched/cls_rsvp6.c
@@ -34,6 +34,7 @@
34#include <net/sock.h> 34#include <net/sock.h>
35#include <net/act_api.h> 35#include <net/act_api.h>
36#include <net/pkt_cls.h> 36#include <net/pkt_cls.h>
37#include <net/netlink.h>
37 38
38#define RSVP_DST_LEN 4 39#define RSVP_DST_LEN 4
39#define RSVP_ID "rsvp6" 40#define RSVP_ID "rsvp6"
diff --git a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c
index 0537d6066b43..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
@@ -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
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
index fa11bb750049..62e1deb27a17 100644
--- a/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -50,6 +50,7 @@
50#include <linux/notifier.h> 50#include <linux/notifier.h>
51#include <linux/rtnetlink.h> 51#include <linux/rtnetlink.h>
52#include <net/ip.h> 52#include <net/ip.h>
53#include <net/netlink.h>
53#include <net/route.h> 54#include <net/route.h>
54#include <linux/skbuff.h> 55#include <linux/skbuff.h>
55#include <net/sock.h> 56#include <net/sock.h>
@@ -772,7 +773,7 @@ static int u32_dump(struct tcf_proto *tp, unsigned long fh,
772 return skb->len; 773 return skb->len;
773 774
774rtattr_failure: 775rtattr_failure:
775 skb_trim(skb, b - skb->data); 776 nlmsg_trim(skb, b);
776 return -1; 777 return -1;
777} 778}
778 779
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 7482a950717b..0b9abea68fd5 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -36,6 +36,7 @@
36#include <linux/bitops.h> 36#include <linux/bitops.h>
37#include <linux/hrtimer.h> 37#include <linux/hrtimer.h>
38 38
39#include <net/netlink.h>
39#include <net/sock.h> 40#include <net/sock.h>
40#include <net/pkt_sched.h> 41#include <net/pkt_sched.h>
41 42
@@ -852,7 +853,7 @@ static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid,
852 853
853nlmsg_failure: 854nlmsg_failure:
854rtattr_failure: 855rtattr_failure:
855 skb_trim(skb, b - skb->data); 856 nlmsg_trim(skb, b);
856 return -1; 857 return -1;
857} 858}
858 859
@@ -1081,7 +1082,7 @@ static int tc_fill_tclass(struct sk_buff *skb, struct Qdisc *q,
1081 1082
1082nlmsg_failure: 1083nlmsg_failure:
1083rtattr_failure: 1084rtattr_failure:
1084 skb_trim(skb, b - skb->data); 1085 nlmsg_trim(skb, b);
1085 return -1; 1086 return -1;
1086} 1087}
1087 1088
diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c
index 1d7bb1632138..0cc3c9b72728 100644
--- a/net/sched/sch_atm.c
+++ b/net/sched/sch_atm.c
@@ -14,6 +14,7 @@
14#include <linux/netdevice.h> 14#include <linux/netdevice.h>
15#include <linux/rtnetlink.h> 15#include <linux/rtnetlink.h>
16#include <linux/file.h> /* for fput */ 16#include <linux/file.h> /* for fput */
17#include <net/netlink.h>
17#include <net/pkt_sched.h> 18#include <net/pkt_sched.h>
18#include <net/sock.h> 19#include <net/sock.h>
19 20
@@ -665,7 +666,7 @@ static int atm_tc_dump_class(struct Qdisc *sch, unsigned long cl,
665 return skb->len; 666 return skb->len;
666 667
667rtattr_failure: 668rtattr_failure:
668 skb_trim(skb,b-skb->data); 669 nlmsg_trim(skb, b);
669 return -1; 670 return -1;
670} 671}
671static int 672static int
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
index be98a01253e9..dcd9c31dc399 100644
--- a/net/sched/sch_cbq.c
+++ b/net/sched/sch_cbq.c
@@ -29,6 +29,7 @@
29#include <linux/etherdevice.h> 29#include <linux/etherdevice.h>
30#include <linux/notifier.h> 30#include <linux/notifier.h>
31#include <net/ip.h> 31#include <net/ip.h>
32#include <net/netlink.h>
32#include <net/route.h> 33#include <net/route.h>
33#include <linux/skbuff.h> 34#include <linux/skbuff.h>
34#include <net/sock.h> 35#include <net/sock.h>
@@ -1471,7 +1472,7 @@ static __inline__ int cbq_dump_rate(struct sk_buff *skb, struct cbq_class *cl)
1471 return skb->len; 1472 return skb->len;
1472 1473
1473rtattr_failure: 1474rtattr_failure:
1474 skb_trim(skb, b - skb->data); 1475 nlmsg_trim(skb, b);
1475 return -1; 1476 return -1;
1476} 1477}
1477 1478
@@ -1496,7 +1497,7 @@ static __inline__ int cbq_dump_lss(struct sk_buff *skb, struct cbq_class *cl)
1496 return skb->len; 1497 return skb->len;
1497 1498
1498rtattr_failure: 1499rtattr_failure:
1499 skb_trim(skb, b - skb->data); 1500 nlmsg_trim(skb, b);
1500 return -1; 1501 return -1;
1501} 1502}
1502 1503
@@ -1514,7 +1515,7 @@ static __inline__ int cbq_dump_wrr(struct sk_buff *skb, struct cbq_class *cl)
1514 return skb->len; 1515 return skb->len;
1515 1516
1516rtattr_failure: 1517rtattr_failure:
1517 skb_trim(skb, b - skb->data); 1518 nlmsg_trim(skb, b);
1518 return -1; 1519 return -1;
1519} 1520}
1520 1521
@@ -1531,7 +1532,7 @@ static __inline__ int cbq_dump_ovl(struct sk_buff *skb, struct cbq_class *cl)
1531 return skb->len; 1532 return skb->len;
1532 1533
1533rtattr_failure: 1534rtattr_failure:
1534 skb_trim(skb, b - skb->data); 1535 nlmsg_trim(skb, b);
1535 return -1; 1536 return -1;
1536} 1537}
1537 1538
@@ -1549,7 +1550,7 @@ static __inline__ int cbq_dump_fopt(struct sk_buff *skb, struct cbq_class *cl)
1549 return skb->len; 1550 return skb->len;
1550 1551
1551rtattr_failure: 1552rtattr_failure:
1552 skb_trim(skb, b - skb->data); 1553 nlmsg_trim(skb, b);
1553 return -1; 1554 return -1;
1554} 1555}
1555 1556
@@ -1568,7 +1569,7 @@ static __inline__ int cbq_dump_police(struct sk_buff *skb, struct cbq_class *cl)
1568 return skb->len; 1569 return skb->len;
1569 1570
1570rtattr_failure: 1571rtattr_failure:
1571 skb_trim(skb, b - skb->data); 1572 nlmsg_trim(skb, b);
1572 return -1; 1573 return -1;
1573} 1574}
1574#endif 1575#endif
@@ -1601,7 +1602,7 @@ static int cbq_dump(struct Qdisc *sch, struct sk_buff *skb)
1601 return skb->len; 1602 return skb->len;
1602 1603
1603rtattr_failure: 1604rtattr_failure:
1604 skb_trim(skb, b - skb->data); 1605 nlmsg_trim(skb, b);
1605 return -1; 1606 return -1;
1606} 1607}
1607 1608
@@ -1637,7 +1638,7 @@ cbq_dump_class(struct Qdisc *sch, unsigned long arg,
1637 return skb->len; 1638 return skb->len;
1638 1639
1639rtattr_failure: 1640rtattr_failure:
1640 skb_trim(skb, b - skb->data); 1641 nlmsg_trim(skb, b);
1641 return -1; 1642 return -1;
1642} 1643}
1643 1644
diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c
index 80e6f811e3bc..6a762cf781d7 100644
--- a/net/sched/sch_hfsc.c
+++ b/net/sched/sch_hfsc.c
@@ -65,6 +65,7 @@
65#include <linux/netdevice.h> 65#include <linux/netdevice.h>
66#include <linux/rtnetlink.h> 66#include <linux/rtnetlink.h>
67#include <linux/pkt_sched.h> 67#include <linux/pkt_sched.h>
68#include <net/netlink.h>
68#include <net/pkt_sched.h> 69#include <net/pkt_sched.h>
69#include <net/pkt_cls.h> 70#include <net/pkt_cls.h>
70#include <asm/system.h> 71#include <asm/system.h>
@@ -1378,7 +1379,7 @@ hfsc_dump_class(struct Qdisc *sch, unsigned long arg, struct sk_buff *skb,
1378 return skb->len; 1379 return skb->len;
1379 1380
1380 rtattr_failure: 1381 rtattr_failure:
1381 skb_trim(skb, b - skb->data); 1382 nlmsg_trim(skb, b);
1382 return -1; 1383 return -1;
1383} 1384}
1384 1385
@@ -1584,7 +1585,7 @@ hfsc_dump_qdisc(struct Qdisc *sch, struct sk_buff *skb)
1584 return skb->len; 1585 return skb->len;
1585 1586
1586 rtattr_failure: 1587 rtattr_failure:
1587 skb_trim(skb, b - skb->data); 1588 nlmsg_trim(skb, b);
1588 return -1; 1589 return -1;
1589} 1590}
1590 1591
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index c687388a8cb6..b7abd0ae676a 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -50,6 +50,7 @@
50#include <linux/skbuff.h> 50#include <linux/skbuff.h>
51#include <linux/list.h> 51#include <linux/list.h>
52#include <linux/compiler.h> 52#include <linux/compiler.h>
53#include <net/netlink.h>
53#include <net/sock.h> 54#include <net/sock.h>
54#include <net/pkt_sched.h> 55#include <net/pkt_sched.h>
55#include <linux/rbtree.h> 56#include <linux/rbtree.h>
@@ -1128,7 +1129,7 @@ static int htb_dump(struct Qdisc *sch, struct sk_buff *skb)
1128 return skb->len; 1129 return skb->len;
1129rtattr_failure: 1130rtattr_failure:
1130 spin_unlock_bh(&sch->dev->queue_lock); 1131 spin_unlock_bh(&sch->dev->queue_lock);
1131 skb_trim(skb, skb_tail_pointer(skb) - skb->data); 1132 nlmsg_trim(skb, skb_tail_pointer(skb));
1132 return -1; 1133 return -1;
1133} 1134}
1134 1135
@@ -1164,7 +1165,7 @@ static int htb_dump_class(struct Qdisc *sch, unsigned long arg,
1164 return skb->len; 1165 return skb->len;
1165rtattr_failure: 1166rtattr_failure:
1166 spin_unlock_bh(&sch->dev->queue_lock); 1167 spin_unlock_bh(&sch->dev->queue_lock);
1167 skb_trim(skb, b - skb->data); 1168 nlmsg_trim(skb, b);
1168 return -1; 1169 return -1;
1169} 1170}
1170 1171
diff --git a/net/sched/sch_ingress.c b/net/sched/sch_ingress.c
index d19f4070c237..f63d5c6eb302 100644
--- a/net/sched/sch_ingress.c
+++ b/net/sched/sch_ingress.c
@@ -16,6 +16,7 @@
16#include <linux/netfilter_ipv6.h> 16#include <linux/netfilter_ipv6.h>
17#include <linux/netfilter.h> 17#include <linux/netfilter.h>
18#include <linux/smp.h> 18#include <linux/smp.h>
19#include <net/netlink.h>
19#include <net/pkt_sched.h> 20#include <net/pkt_sched.h>
20#include <asm/byteorder.h> 21#include <asm/byteorder.h>
21#include <asm/uaccess.h> 22#include <asm/uaccess.h>
@@ -371,7 +372,7 @@ static int ingress_dump(struct Qdisc *sch, struct sk_buff *skb)
371 return skb->len; 372 return skb->len;
372 373
373rtattr_failure: 374rtattr_failure:
374 skb_trim(skb, b - skb->data); 375 nlmsg_trim(skb, b);
375 return -1; 376 return -1;
376} 377}
377 378
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index 2a9b1e429ff8..4818da5a7e6c 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -22,6 +22,7 @@
22#include <linux/skbuff.h> 22#include <linux/skbuff.h>
23#include <linux/rtnetlink.h> 23#include <linux/rtnetlink.h>
24 24
25#include <net/netlink.h>
25#include <net/pkt_sched.h> 26#include <net/pkt_sched.h>
26 27
27#define VERSION "1.2" 28#define VERSION "1.2"
@@ -616,7 +617,7 @@ static int netem_dump(struct Qdisc *sch, struct sk_buff *skb)
616 return skb->len; 617 return skb->len;
617 618
618rtattr_failure: 619rtattr_failure:
619 skb_trim(skb, b - skb->data); 620 nlmsg_trim(skb, b);
620 return -1; 621 return -1;
621} 622}
622 623
diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c
index 5b371109ec1c..f13996348dda 100644
--- a/net/sched/sch_prio.c
+++ b/net/sched/sch_prio.c
@@ -32,6 +32,7 @@
32#include <net/ip.h> 32#include <net/ip.h>
33#include <net/route.h> 33#include <net/route.h>
34#include <linux/skbuff.h> 34#include <linux/skbuff.h>
35#include <net/netlink.h>
35#include <net/sock.h> 36#include <net/sock.h>
36#include <net/pkt_sched.h> 37#include <net/pkt_sched.h>
37 38
@@ -280,7 +281,7 @@ static int prio_dump(struct Qdisc *sch, struct sk_buff *skb)
280 return skb->len; 281 return skb->len;
281 282
282rtattr_failure: 283rtattr_failure:
283 skb_trim(skb, b - skb->data); 284 nlmsg_trim(skb, b);
284 return -1; 285 return -1;
285} 286}
286 287
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c
index a511ba83e26f..96dfdf78d32c 100644
--- a/net/sched/sch_sfq.c
+++ b/net/sched/sch_sfq.c
@@ -30,6 +30,7 @@
30#include <linux/notifier.h> 30#include <linux/notifier.h>
31#include <linux/init.h> 31#include <linux/init.h>
32#include <net/ip.h> 32#include <net/ip.h>
33#include <net/netlink.h>
33#include <linux/ipv6.h> 34#include <linux/ipv6.h>
34#include <net/route.h> 35#include <net/route.h>
35#include <linux/skbuff.h> 36#include <linux/skbuff.h>
@@ -476,7 +477,7 @@ static int sfq_dump(struct Qdisc *sch, struct sk_buff *skb)
476 return skb->len; 477 return skb->len;
477 478
478rtattr_failure: 479rtattr_failure:
479 skb_trim(skb, b - skb->data); 480 nlmsg_trim(skb, b);
480 return -1; 481 return -1;
481} 482}
482 483
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c
index 231895562c66..626ce96800fe 100644
--- a/net/sched/sch_tbf.c
+++ b/net/sched/sch_tbf.c
@@ -32,6 +32,7 @@
32#include <linux/etherdevice.h> 32#include <linux/etherdevice.h>
33#include <linux/notifier.h> 33#include <linux/notifier.h>
34#include <net/ip.h> 34#include <net/ip.h>
35#include <net/netlink.h>
35#include <net/route.h> 36#include <net/route.h>
36#include <linux/skbuff.h> 37#include <linux/skbuff.h>
37#include <net/sock.h> 38#include <net/sock.h>
@@ -408,7 +409,7 @@ static int tbf_dump(struct Qdisc *sch, struct sk_buff *skb)
408 return skb->len; 409 return skb->len;
409 410
410rtattr_failure: 411rtattr_failure:
411 skb_trim(skb, b - skb->data); 412 nlmsg_trim(skb, b);
412 return -1; 413 return -1;
413} 414}
414 415