[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f80d9afa-0ce2-903d-9bf9-b7bb8765086b@6wind.com>
Date: Mon, 2 Oct 2017 11:32:45 +0200
From: Nicolas Dichtel <nicolas.dichtel@...nd.com>
To: "Jason A. Donenfeld" <Jason@...c4.com>,
Netdev <netdev@...r.kernel.org>
Cc: Mathias <mathias@...l-andersen.dk>
Subject: Re: cross namespace interface notification for tun devices
Le 18/09/2017 à 20:47, Jason A. Donenfeld a écrit :
> Hey guys,
>
> It's possible to create a tun device in a process in namespace A and
> then move that interface to namespace B. The controlling process in A
> needs to receive notifications on when the interface is brought up or
> down. It can receive these notifications via netlink while the
> interface lives in A but not when it moves to B.
>
> Any tricks or APIs to get around this?
There are two options.
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).
Regards,
Nicolas
Powered by blists - more mailing lists