Subject: Re: [PATCH iproute2 1/2] ip: display netns name instead of nsid

From: Stephen Hemminger <[email-masked]>
Date: Mon, 4 Jun 2018 14:12:15 -0700

On Mon,  4 Jun 2018 14:12:52 +0200
Nicolas Dichtel <[email-masked]> wrote:

> diff --git a/ip/ipaddress.c b/ip/ipaddress.c
> index c7c7e7df4e81..aee09c7ff6df 100644
> --- a/ip/ipaddress.c
> +++ b/ip/ipaddress.c
> @@ -819,6 +819,9 @@ int print_linkinfo(const struct sockaddr_nl *who,
>  	unsigned int m_flag = 0;
>  	SPRINT_BUF(b1);
>  
> +	netns_nsid_socket_init();
> +	netns_map_init();
> +

The idea of printing network namespace is good but I am concerned that
setting up yet another netlink socket and scanning the netns directory on
each ip link command will impact some users.

Can this setup be deferred until the first net ns lookup happens?