diff options
Diffstat (limited to 'net/sched/cls_flow.c')
-rw-r--r-- | net/sched/cls_flow.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/net/sched/cls_flow.c b/net/sched/cls_flow.c index f05904e3848f..dfd18a5c3e81 100644 --- a/net/sched/cls_flow.c +++ b/net/sched/cls_flow.c | |||
@@ -56,11 +56,6 @@ struct flow_filter { | |||
56 | u32 hashrnd; | 56 | u32 hashrnd; |
57 | }; | 57 | }; |
58 | 58 | ||
59 | static const struct tcf_ext_map flow_ext_map = { | ||
60 | .action = TCA_FLOW_ACT, | ||
61 | .police = TCA_FLOW_POLICE, | ||
62 | }; | ||
63 | |||
64 | static inline u32 addr_fold(void *addr) | 59 | static inline u32 addr_fold(void *addr) |
65 | { | 60 | { |
66 | unsigned long a = (unsigned long)addr; | 61 | unsigned long a = (unsigned long)addr; |
@@ -397,7 +392,8 @@ static int flow_change(struct net *net, struct sk_buff *in_skb, | |||
397 | return -EOPNOTSUPP; | 392 | return -EOPNOTSUPP; |
398 | } | 393 | } |
399 | 394 | ||
400 | err = tcf_exts_validate(net, tp, tb, tca[TCA_RATE], &e, &flow_ext_map); | 395 | tcf_exts_init(&e, TCA_FLOW_ACT, TCA_FLOW_POLICE); |
396 | err = tcf_exts_validate(net, tp, tb, tca[TCA_RATE], &e); | ||
401 | if (err < 0) | 397 | if (err < 0) |
402 | return err; | 398 | return err; |
403 | 399 | ||
@@ -455,7 +451,7 @@ static int flow_change(struct net *net, struct sk_buff *in_skb, | |||
455 | 451 | ||
456 | f->handle = handle; | 452 | f->handle = handle; |
457 | f->mask = ~0U; | 453 | f->mask = ~0U; |
458 | tcf_exts_init(&f->exts); | 454 | tcf_exts_init(&f->exts, TCA_FLOW_ACT, TCA_FLOW_POLICE); |
459 | 455 | ||
460 | get_random_bytes(&f->hashrnd, 4); | 456 | get_random_bytes(&f->hashrnd, 4); |
461 | f->perturb_timer.function = flow_perturbation; | 457 | f->perturb_timer.function = flow_perturbation; |
@@ -609,7 +605,7 @@ static int flow_dump(struct tcf_proto *tp, unsigned long fh, | |||
609 | nla_put_u32(skb, TCA_FLOW_PERTURB, f->perturb_period / HZ)) | 605 | nla_put_u32(skb, TCA_FLOW_PERTURB, f->perturb_period / HZ)) |
610 | goto nla_put_failure; | 606 | goto nla_put_failure; |
611 | 607 | ||
612 | if (tcf_exts_dump(skb, &f->exts, &flow_ext_map) < 0) | 608 | if (tcf_exts_dump(skb, &f->exts) < 0) |
613 | goto nla_put_failure; | 609 | goto nla_put_failure; |
614 | #ifdef CONFIG_NET_EMATCH | 610 | #ifdef CONFIG_NET_EMATCH |
615 | if (f->ematches.hdr.nmatches && | 611 | if (f->ematches.hdr.nmatches && |
@@ -618,7 +614,7 @@ static int flow_dump(struct tcf_proto *tp, unsigned long fh, | |||
618 | #endif | 614 | #endif |
619 | nla_nest_end(skb, nest); | 615 | nla_nest_end(skb, nest); |
620 | 616 | ||
621 | if (tcf_exts_dump_stats(skb, &f->exts, &flow_ext_map) < 0) | 617 | if (tcf_exts_dump_stats(skb, &f->exts) < 0) |
622 | goto nla_put_failure; | 618 | goto nla_put_failure; |
623 | 619 | ||
624 | return skb->len; | 620 | return skb->len; |