From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH iproute2 v2 1/2] ip: display netns name instead of nsid Date: Tue, 5 Jun 2018 09:52:24 -0700 Message-ID: <20180605095224.1921fee5@xeon-e3> References: <20180604141215.0669f05f@xeon-e3> <20180605130831.8175-1-nicolas.dichtel@6wind.com> <20180605130831.8175-2-nicolas.dichtel@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: Nicolas Dichtel Return-path: Received: from mail-pg0-f66.google.com ([74.125.83.66]:36092 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751688AbeFEQwc (ORCPT ); Tue, 5 Jun 2018 12:52:32 -0400 Received: by mail-pg0-f66.google.com with SMTP id m5-v6so1505856pgd.3 for ; Tue, 05 Jun 2018 09:52:32 -0700 (PDT) In-Reply-To: <20180605130831.8175-2-nicolas.dichtel@6wind.com> Sender: netdev-owner@vger.kernel.org List-ID: On Tue, 5 Jun 2018 15:08:30 +0200 Nicolas Dichtel wrote: > > +char *get_name_from_nsid(int nsid) > +{ > + struct nsid_cache *c; > + > + netns_nsid_socket_init(); > + netns_map_init(); > + > + c = netns_map_get_by_nsid(nsid); > + if (c) > + return c->name; > + > + return NULL; > +} > + This is better, but now there is a different problem. When doing multiple interfaces, won't the initialization code be called twice?