aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/cls_route.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/cls_route.c')
-rw-r--r--net/sched/cls_route.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c
index 37da567d833e..1ad3068f2ce1 100644
--- a/net/sched/cls_route.c
+++ b/net/sched/cls_route.c
@@ -59,11 +59,6 @@ struct route4_filter {
59 59
60#define ROUTE4_FAILURE ((struct route4_filter *)(-1L)) 60#define ROUTE4_FAILURE ((struct route4_filter *)(-1L))
61 61
62static const struct tcf_ext_map route_ext_map = {
63 .police = TCA_ROUTE4_POLICE,
64 .action = TCA_ROUTE4_ACT
65};
66
67static inline int route4_fastmap_hash(u32 id, int iif) 62static inline int route4_fastmap_hash(u32 id, int iif)
68{ 63{
69 return id & 0xF; 64 return id & 0xF;
@@ -128,7 +123,7 @@ static inline int route4_hash_wild(void)
128static int route4_classify(struct sk_buff *skb, const struct tcf_proto *tp, 123static int route4_classify(struct sk_buff *skb, const struct tcf_proto *tp,
129 struct tcf_result *res) 124 struct tcf_result *res)
130{ 125{
131 struct route4_head *head = (struct route4_head *)tp->root; 126 struct route4_head *head = tp->root;
132 struct dst_entry *dst; 127 struct dst_entry *dst;
133 struct route4_bucket *b; 128 struct route4_bucket *b;
134 struct route4_filter *f; 129 struct route4_filter *f;
@@ -218,7 +213,7 @@ static inline u32 from_hash(u32 id)
218 213
219static unsigned long route4_get(struct tcf_proto *tp, u32 handle) 214static unsigned long route4_get(struct tcf_proto *tp, u32 handle)
220{ 215{
221 struct route4_head *head = (struct route4_head *)tp->root; 216 struct route4_head *head = tp->root;
222 struct route4_bucket *b; 217 struct route4_bucket *b;
223 struct route4_filter *f; 218 struct route4_filter *f;
224 unsigned int h1, h2; 219 unsigned int h1, h2;
@@ -289,7 +284,7 @@ static void route4_destroy(struct tcf_proto *tp)
289 284
290static int route4_delete(struct tcf_proto *tp, unsigned long arg) 285static int route4_delete(struct tcf_proto *tp, unsigned long arg)
291{ 286{
292 struct route4_head *head = (struct route4_head *)tp->root; 287 struct route4_head *head = tp->root;
293 struct route4_filter **fp, *f = (struct route4_filter *)arg; 288 struct route4_filter **fp, *f = (struct route4_filter *)arg;
294 unsigned int h = 0; 289 unsigned int h = 0;
295 struct route4_bucket *b; 290 struct route4_bucket *b;
@@ -347,7 +342,8 @@ static int route4_set_parms(struct net *net, struct tcf_proto *tp,
347 struct route4_bucket *b; 342 struct route4_bucket *b;
348 struct tcf_exts e; 343 struct tcf_exts e;
349 344
350 err = tcf_exts_validate(net, tp, tb, est, &e, &route_ext_map); 345 tcf_exts_init(&e, TCA_ROUTE4_ACT, TCA_ROUTE4_POLICE);
346 err = tcf_exts_validate(net, tp, tb, est, &e);
351 if (err < 0) 347 if (err < 0)
352 return err; 348 return err;
353 349
@@ -481,6 +477,7 @@ static int route4_change(struct net *net, struct sk_buff *in_skb,
481 if (f == NULL) 477 if (f == NULL)
482 goto errout; 478 goto errout;
483 479
480 tcf_exts_init(&f->exts, TCA_ROUTE4_ACT, TCA_ROUTE4_POLICE);
484 err = route4_set_parms(net, tp, base, f, handle, head, tb, 481 err = route4_set_parms(net, tp, base, f, handle, head, tb,
485 tca[TCA_RATE], 1); 482 tca[TCA_RATE], 1);
486 if (err < 0) 483 if (err < 0)
@@ -554,7 +551,7 @@ static void route4_walk(struct tcf_proto *tp, struct tcf_walker *arg)
554 } 551 }
555} 552}
556 553
557static int route4_dump(struct tcf_proto *tp, unsigned long fh, 554static int route4_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
558 struct sk_buff *skb, struct tcmsg *t) 555 struct sk_buff *skb, struct tcmsg *t)
559{ 556{
560 struct route4_filter *f = (struct route4_filter *)fh; 557 struct route4_filter *f = (struct route4_filter *)fh;
@@ -589,12 +586,12 @@ static int route4_dump(struct tcf_proto *tp, unsigned long fh,
589 nla_put_u32(skb, TCA_ROUTE4_CLASSID, f->res.classid)) 586 nla_put_u32(skb, TCA_ROUTE4_CLASSID, f->res.classid))
590 goto nla_put_failure; 587 goto nla_put_failure;
591 588
592 if (tcf_exts_dump(skb, &f->exts, &route_ext_map) < 0) 589 if (tcf_exts_dump(skb, &f->exts) < 0)
593 goto nla_put_failure; 590 goto nla_put_failure;
594 591
595 nla_nest_end(skb, nest); 592 nla_nest_end(skb, nest);
596 593
597 if (tcf_exts_dump_stats(skb, &f->exts, &route_ext_map) < 0) 594 if (tcf_exts_dump_stats(skb, &f->exts) < 0)
598 goto nla_put_failure; 595 goto nla_put_failure;
599 596
600 return skb->len; 597 return skb->len;