aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/cls_fw.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_fw.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_fw.c')
-rw-r--r--net/sched/cls_fw.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/sched/cls_fw.c b/net/sched/cls_fw.c
index 4075a0aef2aa..1135d8227f9b 100644
--- a/net/sched/cls_fw.c
+++ b/net/sched/cls_fw.c
@@ -192,7 +192,7 @@ static const struct nla_policy fw_policy[TCA_FW_MAX + 1] = {
192}; 192};
193 193
194static int 194static int
195fw_change_attrs(struct tcf_proto *tp, struct fw_filter *f, 195fw_change_attrs(struct net *net, struct tcf_proto *tp, struct fw_filter *f,
196 struct nlattr **tb, struct nlattr **tca, unsigned long base) 196 struct nlattr **tb, struct nlattr **tca, unsigned long base)
197{ 197{
198 struct fw_head *head = (struct fw_head *)tp->root; 198 struct fw_head *head = (struct fw_head *)tp->root;
@@ -200,7 +200,7 @@ fw_change_attrs(struct tcf_proto *tp, struct fw_filter *f,
200 u32 mask; 200 u32 mask;
201 int err; 201 int err;
202 202
203 err = tcf_exts_validate(tp, tb, tca[TCA_RATE], &e, &fw_ext_map); 203 err = tcf_exts_validate(net, tp, tb, tca[TCA_RATE], &e, &fw_ext_map);
204 if (err < 0) 204 if (err < 0)
205 return err; 205 return err;
206 206
@@ -233,7 +233,7 @@ errout:
233 return err; 233 return err;
234} 234}
235 235
236static int fw_change(struct sk_buff *in_skb, 236static int fw_change(struct net *net, struct sk_buff *in_skb,
237 struct tcf_proto *tp, unsigned long base, 237 struct tcf_proto *tp, unsigned long base,
238 u32 handle, 238 u32 handle,
239 struct nlattr **tca, 239 struct nlattr **tca,
@@ -255,7 +255,7 @@ static int fw_change(struct sk_buff *in_skb,
255 if (f != NULL) { 255 if (f != NULL) {
256 if (f->id != handle && handle) 256 if (f->id != handle && handle)
257 return -EINVAL; 257 return -EINVAL;
258 return fw_change_attrs(tp, f, tb, tca, base); 258 return fw_change_attrs(net, tp, f, tb, tca, base);
259 } 259 }
260 260
261 if (!handle) 261 if (!handle)
@@ -282,7 +282,7 @@ static int fw_change(struct sk_buff *in_skb,
282 282
283 f->id = handle; 283 f->id = handle;
284 284
285 err = fw_change_attrs(tp, f, tb, tca, base); 285 err = fw_change_attrs(net, tp, f, tb, tca, base);
286 if (err < 0) 286 if (err < 0)
287 goto errout; 287 goto errout;
288 288