diff options
-rw-r--r-- | net/sched/cls_tcindex.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c index 8d0e83d6903e..30f10fb07f4a 100644 --- a/net/sched/cls_tcindex.c +++ b/net/sched/cls_tcindex.c | |||
@@ -254,10 +254,15 @@ tcindex_set_parms(struct net *net, struct tcf_proto *tp, unsigned long base, | |||
254 | cp->tp = tp; | 254 | cp->tp = tp; |
255 | 255 | ||
256 | if (p->perfect) { | 256 | if (p->perfect) { |
257 | int i; | ||
258 | |||
257 | cp->perfect = kmemdup(p->perfect, | 259 | cp->perfect = kmemdup(p->perfect, |
258 | sizeof(*r) * cp->hash, GFP_KERNEL); | 260 | sizeof(*r) * cp->hash, GFP_KERNEL); |
259 | if (!cp->perfect) | 261 | if (!cp->perfect) |
260 | goto errout; | 262 | goto errout; |
263 | for (i = 0; i < cp->hash; i++) | ||
264 | tcf_exts_init(&cp->perfect[i].exts, | ||
265 | TCA_TCINDEX_ACT, TCA_TCINDEX_POLICE); | ||
261 | balloc = 1; | 266 | balloc = 1; |
262 | } | 267 | } |
263 | cp->h = p->h; | 268 | cp->h = p->h; |
@@ -353,6 +358,9 @@ tcindex_set_parms(struct net *net, struct tcf_proto *tp, unsigned long base, | |||
353 | f = kzalloc(sizeof(*f), GFP_KERNEL); | 358 | f = kzalloc(sizeof(*f), GFP_KERNEL); |
354 | if (!f) | 359 | if (!f) |
355 | goto errout_alloc; | 360 | goto errout_alloc; |
361 | f->key = handle; | ||
362 | tcindex_filter_result_init(&f->result); | ||
363 | f->next = NULL; | ||
356 | } | 364 | } |
357 | 365 | ||
358 | if (tb[TCA_TCINDEX_CLASSID]) { | 366 | if (tb[TCA_TCINDEX_CLASSID]) { |
@@ -376,9 +384,7 @@ tcindex_set_parms(struct net *net, struct tcf_proto *tp, unsigned long base, | |||
376 | struct tcindex_filter *nfp; | 384 | struct tcindex_filter *nfp; |
377 | struct tcindex_filter __rcu **fp; | 385 | struct tcindex_filter __rcu **fp; |
378 | 386 | ||
379 | f->key = handle; | 387 | tcf_exts_change(tp, &f->result.exts, &r->exts); |
380 | f->result = new_filter_result; | ||
381 | f->next = NULL; | ||
382 | 388 | ||
383 | fp = cp->h + (handle % cp->hash); | 389 | fp = cp->h + (handle % cp->hash); |
384 | for (nfp = rtnl_dereference(*fp); | 390 | for (nfp = rtnl_dereference(*fp); |