From: Jiri Benc <jbenc@redhat.com>
To: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Cc: Christian Brauner <christianvanbrauner@gmail.com>,
netdev@vger.kernel.org, ebiederm@xmission.com,
davem@davemloft.net, dsahern@gmail.com, fw@strlen.de,
daniel@iogearbox.net, lucien.xin@gmail.com,
mschiffer@universe-factory.net, jakub.kicinski@netronome.com,
vyasevich@gmail.com, linux-kernel@vger.kernel.org,
w.bumiller@proxmox.com,
Christian Brauner <christian.brauner@ubuntu.com>
Subject: Re: [PATCH net-next 0/3 V1] rtnetlink: enable IFLA_IF_NETNSID for RTM_{DEL,SET}LINK
Date: Wed, 24 Jan 2018 17:35:15 +0100 [thread overview]
Message-ID: <20180124173515.5ae2bc05@redhat.com> (raw)
In-Reply-To: <a0fe573b-c601-9ffc-1f96-0e5f5da86288@6wind.com>
On Wed, 24 Jan 2018 16:24:34 +0100, Nicolas Dichtel wrote:
> I wonder if it would be possible to do something in the netlink framework, like
> NETLINK_LISTEN_ALL_NSID.
> Having some ancillary data at the netlink socket level and a function like
> nlsock_net() (instead of sock_net()) to get the corresponding netns.
> With that, it would be possible, in a generci way, to support this feature for
> all netlink family.
I'm not sure it's worth the effort to do that in the framework. You'll
need modifications all the way down to the code that generates the
attributes anyway.
It's not enough to just specify that the operation should be done on a
different netns and hide that from the handlers. Take for example the
existing RTM_GETLINK. Let's say it's executed from within ns_a and
targeted to ns_b (thus IFLA_IF_NETNSID = netnsid of ns_b). Now, if
there's a veth interface in ns_b whose other end is in ns_c, there will
be IFLA_LINK_NETNSID attribute in the response. But the value has to be
netnsid of ns_c as seen from *ns_a*. If you just pretended to switch to
ns_b before invoking rtnl_getlink, it would be netnsid of ns_c as seen
from ns_b which would be wrong.
That's why 79e1ad148c844 added the tgt_net stuff.
Jiri
next prev parent reply other threads:[~2018-01-24 16:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-24 14:26 [PATCH net-next 0/3 V1] rtnetlink: enable IFLA_IF_NETNSID for RTM_{DEL,SET}LINK Christian Brauner
2018-01-24 14:26 ` [PATCH net-next 1/3 V1] rtnetlink: enable IFLA_IF_NETNSID in do_setlink() Christian Brauner
2018-01-24 14:26 ` [PATCH net-next 2/3 V1] rtnetlink: enable IFLA_IF_NETNSID for RTM_SETLINK Christian Brauner
2018-01-24 14:26 ` [PATCH net-next 3/3 V1] rtnetlink: enable IFLA_IF_NETNSID for RTM_DELLINK Christian Brauner
2018-01-24 15:24 ` [PATCH net-next 0/3 V1] rtnetlink: enable IFLA_IF_NETNSID for RTM_{DEL,SET}LINK Nicolas Dichtel
2018-01-24 16:35 ` Jiri Benc [this message]
2018-01-25 14:20 ` Nicolas Dichtel
2018-01-25 22:30 ` Jiri Benc
2018-01-25 23:34 ` Nicolas Dichtel
2018-01-26 8:36 ` Jiri Benc
2018-01-26 9:28 ` Nicolas Dichtel
2018-01-25 12:59 ` Christian Brauner
2018-01-26 11:33 ` Christian Brauner
2018-01-29 16:31 ` David Miller
2018-01-29 17:09 ` Christian Brauner
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=20180124173515.5ae2bc05@redhat.com \
--to=jbenc@redhat.com \
--cc=christian.brauner@ubuntu.com \
--cc=christianvanbrauner@gmail.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=ebiederm@xmission.com \
--cc=fw@strlen.de \
--cc=jakub.kicinski@netronome.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lucien.xin@gmail.com \
--cc=mschiffer@universe-factory.net \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.com \
--cc=vyasevich@gmail.com \
--cc=w.bumiller@proxmox.com \
/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).