netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Eugene Yakubovich <eugene.yakubovich@coreos.com>, netdev@vger.kernel.org
Subject: Re: What are the intended semantics of IFLA_LINK_NETNSID?
Date: Thu, 26 Feb 2015 09:55:56 +0100	[thread overview]
Message-ID: <54EEDF9C.20302@6wind.com> (raw)
In-Reply-To: <871tldstju.fsf_-_@x220.int.ebiederm.org>

Le 25/02/2015 20:03, Eric W. Biederman a écrit :
>
> Reading through the code of rtnl_newlink I am perplexed with what your
> intended semantics of IFLA_LINK_NETNSID are supposed to be.
>
> My expectation was something with the same semantics IFLA_NET_NS_PID and
> IFLA_NET_NS_FD just a different data representation and something that
> could be used in more netlink messages, so you could report the network
> namespace where the other end of a tunnel or the the network namespace
> of an underlying device is.
>
> Being very slow I would expect that ILFA_LINK_NETNSID would replace
> dest_net or possibly net in rtnl_newlink but it does not replace either
> of those completely.  Which causes me to think that the implementation
> of IFLA_LINK_NETNSID in rtnl_newlink is broken.
>
> I suspect the correct fix for rtnl_newlink is to just use
> IFLA_LINK_NETNSID in rtnl_link_get_net and have it be an alternative way
> of setting dest_net.  But you may intend some different semantics that
> I don't understand.
ILFA_LINK_NETNSID is used to point to the i/o netns of the interface, ie the
opposite netns of dest_net.
The interface is first created in link_net and moved at the end in dest_net.

IP tunnels interfaces (ipip, sit, ip6_tunnels, gre[v6]) does not use src_net,
thus when you create an ipip interface by specifying an attribute
IFLA_NET_NS_PID it will result to an interface which is not across two netns but
only in the netns pointed by IFLA_NET_NS_PID. If you use IFLA_LINK_NETNSID, it
allows you to create this kind of x-netns interfaces.
In fact, the goal of this attribute is to replace the two following command by
only one:
ip link add foo ...
ip link set foo netns bar
=> ip link add foo link-netnsid barID


Regards,
Nicolas

  parent reply	other threads:[~2015-02-26  8:56 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-25  0:48 new link failing on duplicate names in different namespaces Eugene Yakubovich
2015-02-25 16:26 ` Nicolas Dichtel
2015-02-25 17:44   ` Eric W. Biederman
2015-02-26  5:29     ` Cong Wang
2015-02-26  5:56       ` Cong Wang
2015-02-26  9:14         ` Nicolas Dichtel
2015-02-26 13:55           ` Eric W. Biederman
2015-02-26 14:40             ` Nicolas Dichtel
2015-02-27  0:22           ` Cong Wang
2015-02-25 19:03   ` What are the intended semantics of IFLA_LINK_NETNSID? Eric W. Biederman
2015-02-26  5:07     ` Cong Wang
2015-02-26  8:55     ` Nicolas Dichtel [this message]
2015-02-26 13:48       ` Eric W. Biederman
2015-02-26 14:52         ` Nicolas Dichtel
2015-02-26 22:19           ` [PATCH net 1/2] net: Verify permission to dest_net in newlink Eric W. Biederman
2015-02-26 22:20             ` [PATCH net 2/2] net: Verify permission to link_net " Eric W. Biederman
2015-02-27  9:03               ` Nicolas Dichtel
2015-02-28 20:15               ` David Miller
2015-02-27  9:03             ` [PATCH net 1/2] net: Verify permission to dest_net " Nicolas Dichtel
2015-02-28 20:15             ` 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=54EEDF9C.20302@6wind.com \
    --to=nicolas.dichtel@6wind.com \
    --cc=ebiederm@xmission.com \
    --cc=eugene.yakubovich@coreos.com \
    --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).