From: Benjamin LaHaise <bcrl@kvack•org>
To: Eric Dumazet <eric.dumazet@gmail•com>
Cc: David Miller <davem@davemloft•net>,
socketcan@hartkopp•net, netdev@vger•kernel.org
Subject: Re: [PATCH net-next] pkt_sched: namespace aware ifb
Date: Sat, 12 Jan 2013 22:50:13 -0500 [thread overview]
Message-ID: <20130113035013.GJ5259@kvack.org> (raw)
In-Reply-To: <1358046374.20249.1789.camel@edumazet-glaptop>
On Sat, Jan 12, 2013 at 07:06:14PM -0800, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google•com>
>
> act_mirred needs to find the current net_ns, and struct net
> pointer is not provided in the call chain. We run in process
> context and current->nsproxy->net_ns is the needed pointer.
...
I don't think this is correct. Going by the call chain, tcf_action_add can
be called because of a netlink message, and that netlink message may not be
in the same "struct net" as the current process. It looks like the ->init
operation is going to need to have the namespace passed in for this to work
correctly.
-ben
> diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
> index 9c0fd0c..f5a7e18 100644
> --- a/net/sched/act_mirred.c
> +++ b/net/sched/act_mirred.c
> @@ -88,7 +88,7 @@ static int tcf_mirred_init(struct nlattr *nla, struct nlattr *est,
> return -EINVAL;
> }
> if (parm->ifindex) {
> - dev = __dev_get_by_index(&init_net, parm->ifindex);
> + dev = __dev_get_by_index(current->nsproxy->net_ns, parm->ifindex);
> if (dev == NULL)
> return -ENODEV;
> switch (dev->type) {
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger•kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
"Thought is the essence of where you are now."
next prev parent reply other threads:[~2013-01-13 3:50 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-12 13:48 [RFC davem] revert: net: Make skb->skb_iif always track skb->dev Oliver Hartkopp
2013-01-12 18:13 ` Jiri Pirko
2013-01-12 18:40 ` Oliver Hartkopp
2013-01-12 19:37 ` Jiri Pirko
2013-01-12 20:14 ` Oliver Hartkopp
2013-01-12 21:23 ` David Miller
2013-01-12 21:36 ` David Miller
2013-01-13 3:06 ` [PATCH net-next] pkt_sched: namespace aware ifb Eric Dumazet
2013-01-13 3:50 ` Benjamin LaHaise [this message]
2013-01-13 5:49 ` Eric Dumazet
2013-01-13 14:44 ` Jamal Hadi Salim
2013-01-13 16:41 ` Benjamin LaHaise
2013-01-13 16:57 ` Eric Dumazet
2013-01-13 17:25 ` Jamal Hadi Salim
2013-01-14 5:40 ` Eric Dumazet
2013-01-13 17:46 ` [PATCH net-next] ifb: dont hard code inet_net use Eric Dumazet
2013-01-14 13:13 ` Jamal Hadi Salim
2013-01-14 15:15 ` [PATCH net-next] pkt_sched: namespace aware act_mirred Benjamin LaHaise
2013-01-14 20:10 ` David Miller
2013-01-14 20:13 ` [PATCH net-next] ifb: dont hard code inet_net use David Miller
2013-01-13 14:59 ` [PATCH net-next] pkt_sched: namespace aware ifb Benjamin LaHaise
2013-01-13 16:35 ` Eric Dumazet
2013-01-13 11:01 ` [RFC davem] revert: net: Make skb->skb_iif always track skb->dev Oliver Hartkopp
2013-01-13 13:20 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130113035013.GJ5259@kvack.org \
--to=bcrl@kvack$(echo .)org \
--cc=davem@davemloft$(echo .)net \
--cc=eric.dumazet@gmail$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=socketcan@hartkopp$(echo .)net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox