diff options
author | Benjamin LaHaise <bcrl@kvack.org> | 2013-01-14 00:15:39 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-01-14 15:09:36 -0500 |
commit | c1b52739e45f5969b208ebc377f52468280af11e (patch) | |
tree | 313ee0c665f27b7d3ea31c8984879930f1de7021 /net/sched/cls_cgroup.c | |
parent | 605928337866c6369ae60509fa2b10af325a25eb (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_cgroup.c')
-rw-r--r-- | net/sched/cls_cgroup.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c index 6db7855b9029..3a294eb98d61 100644 --- a/net/sched/cls_cgroup.c +++ b/net/sched/cls_cgroup.c | |||
@@ -178,7 +178,7 @@ static const struct nla_policy cgroup_policy[TCA_CGROUP_MAX + 1] = { | |||
178 | [TCA_CGROUP_EMATCHES] = { .type = NLA_NESTED }, | 178 | [TCA_CGROUP_EMATCHES] = { .type = NLA_NESTED }, |
179 | }; | 179 | }; |
180 | 180 | ||
181 | static int cls_cgroup_change(struct sk_buff *in_skb, | 181 | static int cls_cgroup_change(struct net *net, struct sk_buff *in_skb, |
182 | struct tcf_proto *tp, unsigned long base, | 182 | struct tcf_proto *tp, unsigned long base, |
183 | u32 handle, struct nlattr **tca, | 183 | u32 handle, struct nlattr **tca, |
184 | unsigned long *arg) | 184 | unsigned long *arg) |
@@ -215,7 +215,8 @@ static int cls_cgroup_change(struct sk_buff *in_skb, | |||
215 | if (err < 0) | 215 | if (err < 0) |
216 | return err; | 216 | return err; |
217 | 217 | ||
218 | err = tcf_exts_validate(tp, tb, tca[TCA_RATE], &e, &cgroup_ext_map); | 218 | err = tcf_exts_validate(net, tp, tb, tca[TCA_RATE], &e, |
219 | &cgroup_ext_map); | ||
219 | if (err < 0) | 220 | if (err < 0) |
220 | return err; | 221 | return err; |
221 | 222 | ||