aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/act_police.c
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/act_police.c
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/act_police.c')
-rw-r--r--net/sched/act_police.c9
1 files changed, 5 insertions, 4 deletions
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