From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: Netdev <netdev@vger.kernel.org>, Mathias <mathias@hall-andersen.dk>
Subject: Re: cross namespace interface notification for tun devices
Date: Mon, 2 Oct 2017 14:06:59 +0200 [thread overview]
Message-ID: <52f84baf-8027-d01f-8ece-db4f39a2f76f@6wind.com> (raw)
In-Reply-To: <CAHmME9pAvv7ebKC-uZGPJRi9Jasgrd2tgCvS1Lji+cgM1mV2qw@mail.gmail.com>
Le 02/10/2017 à 13:11, Jason A. Donenfeld a écrit :
> On Mon, Oct 2, 2017 at 11:32 AM, Nicolas Dichtel
> <nicolas.dichtel@6wind.com> wrote:
>> 1. Move the process to netns B, open the netlink socket and move back the
>> process to netns A. The socket will remain in netns B and you will receive all
>> netlink messages related to netns B.
>>
>> 2. Assign a nsid to netns B in netns A and use NETLINK_LISTEN_ALL_NSID on your
>> netlink socket (see iproute2).
>
> Both of these seem to rely on the process knowing where the device is
> being moved and having access to that namespace. I don't think these
> two things are a given though. Unless I'm missing something?
I didn't understand correctly.
Your control process cannot monitor or control an interface which is in a
unkown/hidden netns. But x-netns interfaces are special. We already add a way to
identify peer netns for this kind of interfaces.
If an handler get_link_net was added to the rtnl_link_ops of the tun driver, it
will help to identify netns A when you are in netns B. But you need the opposite.
I already try a patch to advertise via netlink the dst netns when an interface
moves to a new netns. I think that it is valid for x-netns interfaces.
As soon as you can identify the dst netns, your problem is solved, right?
Nicolas
next prev parent reply other threads:[~2017-10-02 12:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-18 18:47 cross namespace interface notification for tun devices Jason A. Donenfeld
2017-09-19 1:24 ` Jason A. Donenfeld
2017-09-19 20:40 ` Cong Wang
2017-09-19 21:02 ` Jason A. Donenfeld
2017-09-20 18:29 ` Cong Wang
2017-09-20 19:57 ` Dan Williams
2017-09-20 20:13 ` Jason A. Donenfeld
2017-10-02 9:32 ` Nicolas Dichtel
2017-10-02 11:11 ` Jason A. Donenfeld
2017-10-02 12:06 ` Nicolas Dichtel [this message]
2017-10-03 11:53 ` [PATCH net-next] dev: advertise the new nsid when the netns iface changes Nicolas Dichtel
2017-10-05 1:05 ` 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=52f84baf-8027-d01f-8ece-db4f39a2f76f@6wind.com \
--to=nicolas.dichtel@6wind.com \
--cc=Jason@zx2c4.com \
--cc=mathias@hall-andersen.dk \
--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).