From: Nicolas Dichtel Subject: Re: [PATCH net-next v2 5/5] netns: enable to dump full nsid translation table Date: Thu, 22 Nov 2018 17:42:30 +0100 Message-ID: <4ad08145-b6be-47a5-13f8-ade7e311db0d@6wind.com> References: <20181121110124.5501-1-nicolas.dichtel@6wind.com> <20181122155031.3495-1-nicolas.dichtel@6wind.com> <20181122155031.3495-6-nicolas.dichtel@6wind.com> Reply-To: nicolas.dichtel@6wind.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: netdev@vger.kernel.org, davem@davemloft.net To: David Ahern Return-path: Received: from mail-wm1-f66.google.com ([209.85.128.66]:38146 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728450AbeKWDWm (ORCPT ); Thu, 22 Nov 2018 22:22:42 -0500 Received: by mail-wm1-f66.google.com with SMTP id k198so9749882wmd.3 for ; Thu, 22 Nov 2018 08:42:32 -0800 (PST) In-Reply-To: Content-Language: fr Sender: netdev-owner@vger.kernel.org List-ID: Le 22/11/2018 à 17:40, David Ahern a écrit : > On 11/22/18 8:50 AM, Nicolas Dichtel wrote: >> diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c >> index dd25fb22ad45..25030e0317a2 100644 >> --- a/net/core/net_namespace.c >> +++ b/net/core/net_namespace.c >> @@ -745,6 +745,8 @@ struct net_fill_args { >> int flags; >> int cmd; >> int nsid; >> + bool add_ref; >> + int ref_nsid; >> }; >> >> static int rtnl_net_fill(struct sk_buff *skb, struct net_fill_args *args) >> @@ -763,6 +765,10 @@ static int rtnl_net_fill(struct sk_buff *skb, struct net_fill_args *args) >> if (nla_put_s32(skb, NETNSA_NSID, args->nsid)) >> goto nla_put_failure; >> >> + if (args->add_ref && >> + nla_put_s32(skb, NETNSA_CURRENT_NSID, args->ref_nsid)) >> + goto nla_put_failure; >> + > > you need to add NETNSA_CURRENT_NSID to rtnl_net_get_size. > Good catch. I thought to this and I forgot at the end :/