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_flow.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_flow.c')
-rw-r--r-- | net/sched/cls_flow.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/sched/cls_flow.c b/net/sched/cls_flow.c index ce82d0cb1b47..aa36a8c8b33b 100644 --- a/net/sched/cls_flow.c +++ b/net/sched/cls_flow.c | |||
@@ -351,7 +351,7 @@ static const struct nla_policy flow_policy[TCA_FLOW_MAX + 1] = { | |||
351 | [TCA_FLOW_PERTURB] = { .type = NLA_U32 }, | 351 | [TCA_FLOW_PERTURB] = { .type = NLA_U32 }, |
352 | }; | 352 | }; |
353 | 353 | ||
354 | static int flow_change(struct sk_buff *in_skb, | 354 | static int flow_change(struct net *net, struct sk_buff *in_skb, |
355 | struct tcf_proto *tp, unsigned long base, | 355 | struct tcf_proto *tp, unsigned long base, |
356 | u32 handle, struct nlattr **tca, | 356 | u32 handle, struct nlattr **tca, |
357 | unsigned long *arg) | 357 | unsigned long *arg) |
@@ -397,7 +397,7 @@ static int flow_change(struct sk_buff *in_skb, | |||
397 | return -EOPNOTSUPP; | 397 | return -EOPNOTSUPP; |
398 | } | 398 | } |
399 | 399 | ||
400 | err = tcf_exts_validate(tp, tb, tca[TCA_RATE], &e, &flow_ext_map); | 400 | err = tcf_exts_validate(net, tp, tb, tca[TCA_RATE], &e, &flow_ext_map); |
401 | if (err < 0) | 401 | if (err < 0) |
402 | return err; | 402 | return err; |
403 | 403 | ||