From: ebiederm@xmission.com (Eric W. Biederman)
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
netdev <netdev@vger.kernel.org>, Jouni Malinen <j@w1.fi>
Subject: Re: wireless vs. network namespaces (part II)
Date: Sun, 28 Sep 2008 22:44:14 -0700 [thread overview]
Message-ID: <m1y71b8q1d.fsf@frodo.ebiederm.org> (raw)
In-Reply-To: <1222587651.3798.72.camel@johannes.berg> (Johannes Berg's message of "Sun, 28 Sep 2008 09:40:51 +0200")
>> > * ensure that all netdevs created for this wiphy will have the right
>> > netns.
>> >
>> > The latter part I'm unsure on, alloc_netdev_mq seems to always use
>> > init_net so I can't put them into the right namespace to start with, but
>> > because they're all "in there together" I can't allow switching
>> > namespaces either.. Ideas?
>>
>> alloc_netdev_mq doesn't register the device, so it is a matter of simply
>> changing the network device pointer after allocation and before registration.
>>
>> We do this by default when we dynamically create network devices using
>> netlink. see rtnl_create_link for an example.
>
> Ok. So I guess I'd want to write a wrapper for registering the netdev
> that puts it into the right namespace for the wireless hardware and sets
> the NETIF_F_NETNS_LOCAL flag.
> I'll have to experiment a bit I guess.
So you are looking at using NETIF_F_NETNS_LOCAL to indicate that you can't move
one of the devices?
There is an UNREGISTER_NETDEV event and a REGISTER_NETDEV event sent when a device
is moved between namespaces. See: dev_change_net_namespace.
I think you would want to look onto those and move one network device when you
move the other, without using NETIF_F_NETNS_LOCAL.
Deletion and creation we have definitely done with paired veth devices. I haven't
looked at the migration case, but I with a little bit of guarding against recursion
it looks like it probably can be handled.
Say trigger when your parnter device calls REGISTER_NETDEV in a different network
namespace?
Eric
next prev parent reply other threads:[~2008-09-29 5:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-27 10:01 wireless vs. network namespaces (part II) Johannes Berg
[not found] ` <1222509685.3798.59.camel-YfaajirXv214zXjbi5bjpg@public.gmane.org>
2008-09-28 1:39 ` Eric W. Biederman
2008-09-28 7:40 ` Johannes Berg
2008-09-29 5:44 ` Eric W. Biederman [this message]
2008-09-29 8:19 ` Johannes Berg
2008-09-29 19:03 ` Luis R. Rodriguez
2008-09-29 19:05 ` Johannes Berg
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=m1y71b8q1d.fsf@frodo.ebiederm.org \
--to=ebiederm@xmission.com \
--cc=j@w1.fi \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).