[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191014131500.7dd2b1a8@hermes.lan>
Date: Mon, 14 Oct 2019 13:15:00 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: Nicolas Dichtel <nicolas.dichtel@...nd.com>
Cc: netdev@...r.kernel.org, dsahern@...il.com,
Petr Oros <poros@...hat.com>
Subject: Re: [PATCH iproute2] ipnetns: enable to dump nsid conversion table
On Mon, 7 Oct 2019 15:44:47 +0200
Nicolas Dichtel <nicolas.dichtel@...nd.com> wrote:
> This patch enables to dump/get nsid from a netns into another netns.
>
> Example:
> $ ./test.sh
> + ip netns add foo
> + ip netns add bar
> + touch /var/run/netns/init_net
> + mount --bind /proc/1/ns/net /var/run/netns/init_net
> + ip netns set init_net 11
> + ip netns set foo 12
> + ip netns set bar 13
> + ip netns
> init_net (id: 11)
> bar (id: 13)
> foo (id: 12)
> + ip -n foo netns set init_net 21
> + ip -n foo netns set foo 22
> + ip -n foo netns set bar 23
> + ip -n foo netns
> init_net (id: 21)
> bar (id: 23)
> foo (id: 22)
> + ip -n bar netns set init_net 31
> + ip -n bar netns set foo 32
> + ip -n bar netns set bar 33
> + ip -n bar netns
> init_net (id: 31)
> bar (id: 33)
> foo (id: 32)
> + ip netns list-id target-nsid 12
> nsid 21 current-nsid 11 (iproute2 netns name: init_net)
> nsid 22 current-nsid 12 (iproute2 netns name: foo)
> nsid 23 current-nsid 13 (iproute2 netns name: bar)
> + ip -n foo netns list-id target-nsid 21
> nsid 11 current-nsid 21 (iproute2 netns name: init_net)
> nsid 12 current-nsid 22 (iproute2 netns name: foo)
> nsid 13 current-nsid 23 (iproute2 netns name: bar)
> + ip -n bar netns list-id target-nsid 33 nsid 32
> nsid 32 current-nsid 32 (iproute2 netns name: foo)
> + ip -n bar netns list-id target-nsid 31 nsid 32
> nsid 12 current-nsid 32 (iproute2 netns name: foo)
> + ip netns list-id nsid 13
> nsid 13 (iproute2 netns name: bar)
>
> CC: Petr Oros <poros@...hat.com>
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@...nd.com>
> ---
> include/libnetlink.h | 5 +-
> ip/ip_common.h | 1 +
> ip/ipnetns.c | 115 +++++++++++++++++++++++++++++++++++++++++--
> lib/libnetlink.c | 15 ++++--
> 4 files changed, 126 insertions(+), 10 deletions(-)
>
Applied. Please send another patch to update man page.
Powered by blists - more mailing lists