aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/cls_api.c
diff options
context:
space:
mode:
authorBenjamin LaHaise <bcrl@kvack.org>2013-01-14 00:15:39 -0500
committerDavid S. Miller <davem@davemloft.net>2013-01-14 15:09:36 -0500
commitc1b52739e45f5969b208ebc377f52468280af11e (patch)
tree313ee0c665f27b7d3ea31c8984879930f1de7021 /net/sched/cls_api.c
parent605928337866c6369ae60509fa2b10af325a25eb (diff)
pkt_sched: namespace aware act_mirred
Eric Dumazet pointed out that act_mirred needs to find the current net_ns, and struct net pointer is not provided in the call chain. His original patch made use of current->nsproxy->net_ns to find the network namespace, but this fails to work correctly for userspace code that makes use of netlink sockets in different network namespaces. Instead, pass the "struct net *" down along the call chain to where it is needed. This version removes the ifb changes as Eric has submitted that patch separately, but is otherwise identical to the previous version. Signed-off-by: Benjamin LaHaise <bcrl@kvack.org> Tested-by: Eric Dumazet <eric.dumazet@gmail.com> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/cls_api.c')
-rw-r--r--net/sched/cls_api.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index ff55ed6c49b2..964f5e4f4b8a 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -321,7 +321,7 @@ replay:
321 } 321 }
322 } 322 }
323 323
324 err = tp->ops->change(skb, tp, cl, t->tcm_handle, tca, &fh); 324 err = tp->ops->change(net, skb, tp, cl, t->tcm_handle, tca, &fh);
325 if (err == 0) { 325 if (err == 0) {
326 if (tp_created) { 326 if (tp_created) {
327 spin_lock_bh(root_lock); 327 spin_lock_bh(root_lock);
@@ -508,7 +508,7 @@ void tcf_exts_destroy(struct tcf_proto *tp, struct tcf_exts *exts)
508} 508}
509EXPORT_SYMBOL(tcf_exts_destroy); 509EXPORT_SYMBOL(tcf_exts_destroy);
510 510
511int tcf_exts_validate(struct tcf_proto *tp, struct nlattr **tb, 511int tcf_exts_validate(struct net *net, struct tcf_proto *tp, struct nlattr **tb,
512 struct nlattr *rate_tlv, struct tcf_exts *exts, 512 struct nlattr *rate_tlv, struct tcf_exts *exts,
513 const struct tcf_ext_map *map) 513 const struct tcf_ext_map *map)
514{ 514{
@@ -519,7 +519,7 @@ int tcf_exts_validate(struct tcf_proto *tp, struct nlattr **tb,
519 struct tc_action *act; 519 struct tc_action *act;
520 520
521 if (map->police && tb[map->police]) { 521 if (map->police && tb[map->police]) {
522 act = tcf_action_init_1(tb[map->police], rate_tlv, 522 act = tcf_action_init_1(net, tb[map->police], rate_tlv,
523 "police", TCA_ACT_NOREPLACE, 523 "police", TCA_ACT_NOREPLACE,
524 TCA_ACT_BIND); 524 TCA_ACT_BIND);
525 if (IS_ERR(act)) 525 if (IS_ERR(act))
@@ -528,8 +528,9 @@ int tcf_exts_validate(struct tcf_proto *tp, struct nlattr **tb,
528 act->type = TCA_OLD_COMPAT; 528 act->type = TCA_OLD_COMPAT;
529 exts->action = act; 529 exts->action = act;
530 } else if (map->action && tb[map->action]) { 530 } else if (map->action && tb[map->action]) {
531 act = tcf_action_init(tb[map->action], rate_tlv, NULL, 531 act = tcf_action_init(net, tb[map->action], rate_tlv,
532 TCA_ACT_NOREPLACE, TCA_ACT_BIND); 532 NULL, TCA_ACT_NOREPLACE,
533 TCA_ACT_BIND);
533 if (IS_ERR(act)) 534 if (IS_ERR(act))
534 return PTR_ERR(act); 535 return PTR_ERR(act);
535 536