Re: [PATCH 5/5] net: namespace: allow setting NSIDs outside current namespace

From: Nicolas Dichtel
Date: Tue Nov 05 2019 - 10:49:38 EST


Le 05/11/2019 Ã 09:11, Jonas Bonn a ÃcritÂ:
> Currently it is only possible to move an interface to a new namespace if
> the destination namespace has an ID in the interface's current namespace.
> If the interface already resides outside of the current namespace, then
> we may need to assign the destination namespace an ID in the interface's
> namespace in order to effect the move.
>
> This patch allows namespace ID's to be created outside of the current
> namespace. With this, the following is possible:
>
> i) Our namespace is 'A'.
> ii) The interface resides in namespace 'B'
> iii) We can assign an ID for NS 'A' in NS 'B'
> iv) We can then move the interface into our own namespace.
>
> and
>
> i) Our namespace is 'A'; namespaces 'B' and 'C' also exist
> ii) We can assign an ID for namespace 'C' in namespace 'B'
> iii) We can then create a VETH interface directly in namespace 'B' with
> the other end in 'C', all without ever leaving namespace 'A'
>
> Signed-off-by: Jonas Bonn <jonas@xxxxxxxxxxx>
Acked-by: Nicolas Dichtel <nicolas.dichtel@xxxxxxxxx>