diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-03-26 02:06:12 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:26:37 -0400 |
commit | dc5fc579b90ed0a9a4e55b0218cdbaf0a8cf2e67 (patch) | |
tree | 673dbb425c2b09b4256ef71f89dfc5cc01944386 | |
parent | a36ca733375860b389c15ffdf6a5f92df64a33b6 (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>
34 files changed, 93 insertions, 62 deletions
diff --git a/include/net/netlink.h b/include/net/netlink.h index 2c7ab107f20d..510ca7fabe18 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h | |||
@@ -548,7 +548,7 @@ static inline void *nlmsg_get_pos(struct sk_buff *skb) | |||
548 | * | 548 | * |
549 | * Trims the message to the provided mark. Returns -1. | 549 | * Trims the message to the provided mark. Returns -1. |
550 | */ | 550 | */ |
551 | static inline int nlmsg_trim(struct sk_buff *skb, void *mark) | 551 | static inline int nlmsg_trim(struct sk_buff *skb, const void *mark) |
552 | { | 552 | { |
553 | if (mark) | 553 | if (mark) |
554 | skb_trim(skb, (unsigned char *) mark - skb->data); | 554 | skb_trim(skb, (unsigned char *) mark - skb->data); |
diff --git a/net/core/wireless.c b/net/core/wireless.c index 4a777b68e3bc..86db63d7f760 100644 --- a/net/core/wireless.c +++ b/net/core/wireless.c | |||
@@ -1957,7 +1957,7 @@ static inline int rtnetlink_fill_iwinfo(struct sk_buff * skb, | |||
1957 | 1957 | ||
1958 | nlmsg_failure: | 1958 | nlmsg_failure: |
1959 | rtattr_failure: | 1959 | rtattr_failure: |
1960 | skb_trim(skb, b - skb->data); | 1960 | nlmsg_trim(skb, b); |
1961 | return -1; | 1961 | return -1; |
1962 | } | 1962 | } |
1963 | 1963 | ||
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c index 9678b096b844..2ae35ef1f077 100644 --- a/net/decnet/dn_route.c +++ b/net/decnet/dn_route.c | |||
@@ -77,6 +77,7 @@ | |||
77 | #include <linux/rcupdate.h> | 77 | #include <linux/rcupdate.h> |
78 | #include <linux/times.h> | 78 | #include <linux/times.h> |
79 | #include <asm/errno.h> | 79 | #include <asm/errno.h> |
80 | #include <net/netlink.h> | ||
80 | #include <net/neighbour.h> | 81 | #include <net/neighbour.h> |
81 | #include <net/dst.h> | 82 | #include <net/dst.h> |
82 | #include <net/flow.h> | 83 | #include <net/flow.h> |
@@ -1514,7 +1515,7 @@ static int dn_rt_fill_info(struct sk_buff *skb, u32 pid, u32 seq, | |||
1514 | 1515 | ||
1515 | nlmsg_failure: | 1516 | nlmsg_failure: |
1516 | rtattr_failure: | 1517 | rtattr_failure: |
1517 | skb_trim(skb, b - skb->data); | 1518 | nlmsg_trim(skb, b); |
1518 | return -1; | 1519 | return -1; |
1519 | } | 1520 | } |
1520 | 1521 | ||
diff --git a/net/decnet/dn_table.c b/net/decnet/dn_table.c index 544c45540746..d6615c9361e9 100644 --- a/net/decnet/dn_table.c +++ b/net/decnet/dn_table.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <asm/uaccess.h> | 28 | #include <asm/uaccess.h> |
29 | #include <linux/route.h> /* RTF_xxx */ | 29 | #include <linux/route.h> /* RTF_xxx */ |
30 | #include <net/neighbour.h> | 30 | #include <net/neighbour.h> |
31 | #include <net/netlink.h> | ||
31 | #include <net/dst.h> | 32 | #include <net/dst.h> |
32 | #include <net/flow.h> | 33 | #include <net/flow.h> |
33 | #include <net/fib_rules.h> | 34 | #include <net/fib_rules.h> |
@@ -349,7 +350,7 @@ static int dn_fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event, | |||
349 | 350 | ||
350 | nlmsg_failure: | 351 | nlmsg_failure: |
351 | rtattr_failure: | 352 | rtattr_failure: |
352 | skb_trim(skb, b - skb->data); | 353 | nlmsg_trim(skb, b); |
353 | return -EMSGSIZE; | 354 | return -EMSGSIZE; |
354 | } | 355 | } |
355 | 356 | ||
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index 238999e6e871..62c2e9f7e11f 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <net/inet_hashtables.h> | 27 | #include <net/inet_hashtables.h> |
28 | #include <net/inet_timewait_sock.h> | 28 | #include <net/inet_timewait_sock.h> |
29 | #include <net/inet6_hashtables.h> | 29 | #include <net/inet6_hashtables.h> |
30 | #include <net/netlink.h> | ||
30 | 31 | ||
31 | #include <linux/inet.h> | 32 | #include <linux/inet.h> |
32 | #include <linux/stddef.h> | 33 | #include <linux/stddef.h> |
@@ -152,7 +153,7 @@ static int inet_csk_diag_fill(struct sock *sk, | |||
152 | 153 | ||
153 | rtattr_failure: | 154 | rtattr_failure: |
154 | nlmsg_failure: | 155 | nlmsg_failure: |
155 | skb_trim(skb, b - skb->data); | 156 | nlmsg_trim(skb, b); |
156 | return -EMSGSIZE; | 157 | return -EMSGSIZE; |
157 | } | 158 | } |
158 | 159 | ||
@@ -208,7 +209,7 @@ static int inet_twsk_diag_fill(struct inet_timewait_sock *tw, | |||
208 | nlh->nlmsg_len = skb_tail_pointer(skb) - previous_tail; | 209 | nlh->nlmsg_len = skb_tail_pointer(skb) - previous_tail; |
209 | return skb->len; | 210 | return skb->len; |
210 | nlmsg_failure: | 211 | nlmsg_failure: |
211 | skb_trim(skb, previous_tail - skb->data); | 212 | nlmsg_trim(skb, previous_tail); |
212 | return -EMSGSIZE; | 213 | return -EMSGSIZE; |
213 | } | 214 | } |
214 | 215 | ||
@@ -579,7 +580,7 @@ static int inet_diag_fill_req(struct sk_buff *skb, struct sock *sk, | |||
579 | return skb->len; | 580 | return skb->len; |
580 | 581 | ||
581 | nlmsg_failure: | 582 | nlmsg_failure: |
582 | skb_trim(skb, b - skb->data); | 583 | nlmsg_trim(skb, b); |
583 | return -1; | 584 | return -1; |
584 | } | 585 | } |
585 | 586 | ||
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index ea0a491dce92..48027df5a90b 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
@@ -62,6 +62,7 @@ | |||
62 | #include <linux/netfilter_ipv4.h> | 62 | #include <linux/netfilter_ipv4.h> |
63 | #include <net/ipip.h> | 63 | #include <net/ipip.h> |
64 | #include <net/checksum.h> | 64 | #include <net/checksum.h> |
65 | #include <net/netlink.h> | ||
65 | 66 | ||
66 | #if defined(CONFIG_IP_PIMSM_V1) || defined(CONFIG_IP_PIMSM_V2) | 67 | #if defined(CONFIG_IP_PIMSM_V1) || defined(CONFIG_IP_PIMSM_V2) |
67 | #define CONFIG_IP_PIMSM 1 | 68 | #define CONFIG_IP_PIMSM 1 |
@@ -1570,7 +1571,7 @@ ipmr_fill_mroute(struct sk_buff *skb, struct mfc_cache *c, struct rtmsg *rtm) | |||
1570 | return 1; | 1571 | return 1; |
1571 | 1572 | ||
1572 | rtattr_failure: | 1573 | rtattr_failure: |
1573 | skb_trim(skb, b - skb->data); | 1574 | nlmsg_trim(skb, b); |
1574 | return -EMSGSIZE; | 1575 | return -EMSGSIZE; |
1575 | } | 1576 | } |
1576 | 1577 | ||
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index 442300c633d7..76f11f325919 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/notifier.h> | 33 | #include <linux/notifier.h> |
34 | 34 | ||
35 | #include <linux/netfilter.h> | 35 | #include <linux/netfilter.h> |
36 | #include <net/netlink.h> | ||
36 | #include <net/netfilter/nf_conntrack.h> | 37 | #include <net/netfilter/nf_conntrack.h> |
37 | #include <net/netfilter/nf_conntrack_core.h> | 38 | #include <net/netfilter/nf_conntrack_core.h> |
38 | #include <net/netfilter/nf_conntrack_expect.h> | 39 | #include <net/netfilter/nf_conntrack_expect.h> |
@@ -306,7 +307,7 @@ ctnetlink_fill_info(struct sk_buff *skb, u32 pid, u32 seq, | |||
306 | 307 | ||
307 | nlmsg_failure: | 308 | nlmsg_failure: |
308 | nfattr_failure: | 309 | nfattr_failure: |
309 | skb_trim(skb, b - skb->data); | 310 | nlmsg_trim(skb, b); |
310 | return -1; | 311 | return -1; |
311 | } | 312 | } |
312 | 313 | ||
@@ -1169,7 +1170,7 @@ ctnetlink_exp_fill_info(struct sk_buff *skb, u32 pid, u32 seq, | |||
1169 | 1170 | ||
1170 | nlmsg_failure: | 1171 | nlmsg_failure: |
1171 | nfattr_failure: | 1172 | nfattr_failure: |
1172 | skb_trim(skb, b - skb->data); | 1173 | nlmsg_trim(skb, b); |
1173 | return -1; | 1174 | return -1; |
1174 | } | 1175 | } |
1175 | 1176 | ||
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 | ||
35 | void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo) | 36 | void 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 | ||
116 | rtattr_failure: | 117 | rtattr_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; |
146 | rtattr_failure: | 147 | rtattr_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 | ||
442 | rtattr_failure: | 443 | rtattr_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) | |||
467 | rtattr_failure: | 468 | rtattr_failure: |
468 | err = -EINVAL; | 469 | err = -EINVAL; |
469 | errout: | 470 | errout: |
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 | ||
659 | rtattr_failure: | 660 | rtattr_failure: |
660 | nlmsg_failure: | 661 | nlmsg_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) | |||
1070 | rtattr_failure: | 1071 | rtattr_failure: |
1071 | nlmsg_failure: | 1072 | nlmsg_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 | ||
183 | rtattr_failure: | 184 | rtattr_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 | ||
279 | rtattr_failure: | 280 | rtattr_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 | ||
227 | rtattr_failure: | 228 | rtattr_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 | ||
228 | rtattr_failure: | 229 | rtattr_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 | ||
104 | rtattr_failure: | 105 | rtattr_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 | ||
357 | rtattr_failure: | 358 | rtattr_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 | ||
600 | rtattr_failure: | 601 | rtattr_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 | ||
175 | rtattr_failure: | 176 | rtattr_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 | ||
346 | nlmsg_failure: | 348 | nlmsg_failure: |
347 | rtattr_failure: | 349 | rtattr_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 | ||
269 | rtattr_failure: | 270 | rtattr_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 | ||
384 | rtattr_failure: | 385 | rtattr_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 | ||
601 | rtattr_failure: | 602 | rtattr_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 | ||
632 | rtattr_failure: | 632 | rtattr_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 | ||
497 | rtattr_failure: | 498 | rtattr_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 | ||
774 | rtattr_failure: | 775 | rtattr_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 | ||
853 | nlmsg_failure: | 854 | nlmsg_failure: |
854 | rtattr_failure: | 855 | rtattr_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 | ||
1082 | nlmsg_failure: | 1083 | nlmsg_failure: |
1083 | rtattr_failure: | 1084 | rtattr_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 | ||
667 | rtattr_failure: | 668 | rtattr_failure: |
668 | skb_trim(skb,b-skb->data); | 669 | nlmsg_trim(skb, b); |
669 | return -1; | 670 | return -1; |
670 | } | 671 | } |
671 | static int | 672 | static 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 | ||
1473 | rtattr_failure: | 1474 | rtattr_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 | ||
1498 | rtattr_failure: | 1499 | rtattr_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 | ||
1516 | rtattr_failure: | 1517 | rtattr_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 | ||
1533 | rtattr_failure: | 1534 | rtattr_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 | ||
1551 | rtattr_failure: | 1552 | rtattr_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 | ||
1570 | rtattr_failure: | 1571 | rtattr_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 | ||
1603 | rtattr_failure: | 1604 | rtattr_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 | ||
1639 | rtattr_failure: | 1640 | rtattr_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; |
1129 | rtattr_failure: | 1130 | rtattr_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; |
1165 | rtattr_failure: | 1166 | rtattr_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 | ||
373 | rtattr_failure: | 374 | rtattr_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 | ||
618 | rtattr_failure: | 619 | rtattr_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 | ||
282 | rtattr_failure: | 283 | rtattr_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 | ||
478 | rtattr_failure: | 479 | rtattr_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 | ||
410 | rtattr_failure: | 411 | rtattr_failure: |
411 | skb_trim(skb, b - skb->data); | 412 | nlmsg_trim(skb, b); |
412 | return -1; | 413 | return -1; |
413 | } | 414 | } |
414 | 415 | ||
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index 814bb3125ada..6b7f6dc144c7 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -628,7 +628,7 @@ out: | |||
628 | 628 | ||
629 | nlmsg_failure: | 629 | nlmsg_failure: |
630 | rtattr_failure: | 630 | rtattr_failure: |
631 | skb_trim(skb, b - skb->data); | 631 | nlmsg_trim(skb, b); |
632 | return -1; | 632 | return -1; |
633 | } | 633 | } |
634 | 634 | ||
@@ -1182,7 +1182,7 @@ out: | |||
1182 | return 0; | 1182 | return 0; |
1183 | 1183 | ||
1184 | nlmsg_failure: | 1184 | nlmsg_failure: |
1185 | skb_trim(skb, b - skb->data); | 1185 | nlmsg_trim(skb, b); |
1186 | return -1; | 1186 | return -1; |
1187 | } | 1187 | } |
1188 | 1188 | ||
@@ -1367,7 +1367,7 @@ static int build_aevent(struct sk_buff *skb, struct xfrm_state *x, struct km_eve | |||
1367 | 1367 | ||
1368 | rtattr_failure: | 1368 | rtattr_failure: |
1369 | nlmsg_failure: | 1369 | nlmsg_failure: |
1370 | skb_trim(skb, b - skb->data); | 1370 | nlmsg_trim(skb, b); |
1371 | return -1; | 1371 | return -1; |
1372 | } | 1372 | } |
1373 | 1373 | ||
@@ -1767,7 +1767,7 @@ static int build_migrate(struct sk_buff *skb, struct xfrm_migrate *m, | |||
1767 | nlh->nlmsg_len = skb_tail_pointer(skb) - b; | 1767 | nlh->nlmsg_len = skb_tail_pointer(skb) - b; |
1768 | return skb->len; | 1768 | return skb->len; |
1769 | nlmsg_failure: | 1769 | nlmsg_failure: |
1770 | skb_trim(skb, b - skb->data); | 1770 | nlmsg_trim(skb, b); |
1771 | return -1; | 1771 | return -1; |
1772 | } | 1772 | } |
1773 | 1773 | ||
@@ -1956,7 +1956,7 @@ static int build_expire(struct sk_buff *skb, struct xfrm_state *x, struct km_eve | |||
1956 | return skb->len; | 1956 | return skb->len; |
1957 | 1957 | ||
1958 | nlmsg_failure: | 1958 | nlmsg_failure: |
1959 | skb_trim(skb, b - skb->data); | 1959 | nlmsg_trim(skb, b); |
1960 | return -1; | 1960 | return -1; |
1961 | } | 1961 | } |
1962 | 1962 | ||
@@ -2157,7 +2157,7 @@ static int build_acquire(struct sk_buff *skb, struct xfrm_state *x, | |||
2157 | return skb->len; | 2157 | return skb->len; |
2158 | 2158 | ||
2159 | nlmsg_failure: | 2159 | nlmsg_failure: |
2160 | skb_trim(skb, b - skb->data); | 2160 | nlmsg_trim(skb, b); |
2161 | return -1; | 2161 | return -1; |
2162 | } | 2162 | } |
2163 | 2163 | ||
@@ -2268,7 +2268,7 @@ static int build_polexpire(struct sk_buff *skb, struct xfrm_policy *xp, | |||
2268 | return skb->len; | 2268 | return skb->len; |
2269 | 2269 | ||
2270 | nlmsg_failure: | 2270 | nlmsg_failure: |
2271 | skb_trim(skb, b - skb->data); | 2271 | nlmsg_trim(skb, b); |
2272 | return -1; | 2272 | return -1; |
2273 | } | 2273 | } |
2274 | 2274 | ||
@@ -2427,7 +2427,7 @@ static int build_report(struct sk_buff *skb, u8 proto, | |||
2427 | 2427 | ||
2428 | nlmsg_failure: | 2428 | nlmsg_failure: |
2429 | rtattr_failure: | 2429 | rtattr_failure: |
2430 | skb_trim(skb, b - skb->data); | 2430 | nlmsg_trim(skb, b); |
2431 | return -1; | 2431 | return -1; |
2432 | } | 2432 | } |
2433 | 2433 | ||