diff options
| -rw-r--r-- | net/sched/act_police.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/net/sched/act_police.c b/net/sched/act_police.c index 537a48732e9e..7ebf7439b478 100644 --- a/net/sched/act_police.c +++ b/net/sched/act_police.c | |||
| @@ -350,22 +350,19 @@ tcf_act_police_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) | |||
| 350 | { | 350 | { |
| 351 | unsigned char *b = skb_tail_pointer(skb); | 351 | unsigned char *b = skb_tail_pointer(skb); |
| 352 | struct tcf_police *police = a->priv; | 352 | struct tcf_police *police = a->priv; |
| 353 | struct tc_police opt; | 353 | struct tc_police opt = { |
| 354 | 354 | .index = police->tcf_index, | |
| 355 | opt.index = police->tcf_index; | 355 | .action = police->tcf_action, |
| 356 | opt.action = police->tcf_action; | 356 | .mtu = police->tcfp_mtu, |
| 357 | opt.mtu = police->tcfp_mtu; | 357 | .burst = police->tcfp_burst, |
| 358 | opt.burst = police->tcfp_burst; | 358 | .refcnt = police->tcf_refcnt - ref, |
| 359 | opt.refcnt = police->tcf_refcnt - ref; | 359 | .bindcnt = police->tcf_bindcnt - bind, |
| 360 | opt.bindcnt = police->tcf_bindcnt - bind; | 360 | }; |
| 361 | |||
| 361 | if (police->tcfp_R_tab) | 362 | if (police->tcfp_R_tab) |
| 362 | opt.rate = police->tcfp_R_tab->rate; | 363 | opt.rate = police->tcfp_R_tab->rate; |
| 363 | else | ||
| 364 | memset(&opt.rate, 0, sizeof(opt.rate)); | ||
| 365 | if (police->tcfp_P_tab) | 364 | if (police->tcfp_P_tab) |
| 366 | opt.peakrate = police->tcfp_P_tab->rate; | 365 | opt.peakrate = police->tcfp_P_tab->rate; |
| 367 | else | ||
| 368 | memset(&opt.peakrate, 0, sizeof(opt.peakrate)); | ||
| 369 | NLA_PUT(skb, TCA_POLICE_TBF, sizeof(opt), &opt); | 366 | NLA_PUT(skb, TCA_POLICE_TBF, sizeof(opt), &opt); |
| 370 | if (police->tcfp_result) | 367 | if (police->tcfp_result) |
| 371 | NLA_PUT_U32(skb, TCA_POLICE_RESULT, police->tcfp_result); | 368 | NLA_PUT_U32(skb, TCA_POLICE_RESULT, police->tcfp_result); |
