From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: Jonas Bonn <jonas@norrbonn.se>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: davem@davemloft.net
Subject: Re: [PATCH 1/5] rtnetlink: allow RTM_SETLINK to reference other namespaces
Date: Tue, 5 Nov 2019 16:41:14 +0100 [thread overview]
Message-ID: <4c57e4b2-13d2-63e0-c513-62cd786497eb@6wind.com> (raw)
In-Reply-To: <20191105081112.16656-2-jonas@norrbonn.se>
Le 05/11/2019 à 09:11, Jonas Bonn a écrit :
> Netlink currently has partial support for acting on interfaces outside
> the current namespace. This patch extends RTM_SETLINK with this
> functionality.
>
> The current implementation has an unfortunate semantic ambiguity in the
> IFLA_TARGET_NETNSID attribute. For setting the interface namespace, one
> may pass the IFLA_TARGET_NETNSID attribute with the namespace to move the
> interface to. This conflicts with the meaning of this attribute for all
> other methods where IFLA_TARGET_NETNSID identifies the namespace in
> which to search for the interface to act upon: the pair (namespace,
> ifindex) is generally given by (IFLA_TARGET_NETNSID, ifi->ifi_index).
>
> In order to change the namespace of an interface outside the current
> namespace, we would need to specify both an IFLA_TARGET_NETNSID
> attribute and a namespace to move to using IFLA_NET_NS_[PID|FD]. This is
> currently now allowed as only one of these three flags may be specified.
>
> This patch loosens the restrictions a bit but tries to maintain
> compatibility with the previous behaviour:
> i) IFLA_TARGET_NETNSID may be passed together with one of
> IFLA_NET_NS_[PID|FD]
> ii) IFLA_TARGET_NETNSID is primarily defined to be the namespace in
> which to find the interface to act upon
> iii) In order to maintain backwards compatibility, if the device is not
> found in the specified namespace, we also look for it in the current
> namespace
> iv) If only IFLA_TARGET_NETNSID is given, the device is still moved to
> that namespace, as before; and, as before, IFLA_NET_NS_[PID|FD] take
> precedence as namespace selectors
>
> Ideally, IFLA_TARGET_NETNSID would only ever have been used to select the
> namespace of the device to act upon. A separate flag, IFLA_NET_NS_ID
> would have been made available for changing namespaces
>
> Signed-off-by: Jonas Bonn <jonas@norrbonn.se>
Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
next prev parent reply other threads:[~2019-11-05 15:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-05 8:11 [PATCH 0/5] Add namespace awareness to Netlink methods Jonas Bonn
2019-11-05 8:11 ` [PATCH 1/5] rtnetlink: allow RTM_SETLINK to reference other namespaces Jonas Bonn
2019-11-05 15:41 ` Nicolas Dichtel [this message]
2019-11-05 8:11 ` [PATCH 2/5] rtnetlink: skip namespace change if already effect Jonas Bonn
2019-11-05 15:42 ` Nicolas Dichtel
2019-11-05 8:11 ` [PATCH 3/5] rtnetlink: allow RTM_NEWLINK to act upon interfaces in arbitrary namespaces Jonas Bonn
2019-11-05 15:43 ` Nicolas Dichtel
2019-11-05 8:11 ` [PATCH 4/5] net: ipv4: allow setting address on interface outside current namespace Jonas Bonn
2019-11-05 15:47 ` Nicolas Dichtel
2019-11-05 8:11 ` [PATCH 5/5] net: namespace: allow setting NSIDs " Jonas Bonn
2019-11-05 15:49 ` Nicolas Dichtel
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=4c57e4b2-13d2-63e0-c513-62cd786497eb@6wind.com \
--to=nicolas.dichtel@6wind.com \
--cc=davem@davemloft.net \
--cc=jonas@norrbonn.se \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®