From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751444AbeAYXe5 (ORCPT ); Thu, 25 Jan 2018 18:34:57 -0500 Received: from mail-wm0-f53.google.com ([74.125.82.53]:42516 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751296AbeAYXez (ORCPT ); Thu, 25 Jan 2018 18:34:55 -0500 X-Google-Smtp-Source: AH8x225JpcpdIvEi8i7/WRnhyBNzRyvGB1u+vKkuO1LMjNKlt6JEiweSoF70tMhzDUir9eMcJ2Rlfg== Reply-To: nicolas.dichtel@6wind.com Subject: Re: [PATCH net-next 0/3 V1] rtnetlink: enable IFLA_IF_NETNSID for RTM_{DEL,SET}LINK References: <20180124142634.17766-1-christian.brauner@ubuntu.com> <20180124173515.5ae2bc05@redhat.com> <20180125233043.66ff08c2@redhat.com> To: Jiri Benc Cc: Christian Brauner , netdev@vger.kernel.org, ebiederm@xmission.com, davem@davemloft.net, dsahern@gmail.com, fw@strlen.de, daniel@iogearbox.net, lucien.xin@gmail.com, mschiffer@universe-factory.net, jakub.kicinski@netronome.com, vyasevich@gmail.com, linux-kernel@vger.kernel.org, w.bumiller@proxmox.com, Christian Brauner From: Nicolas Dichtel Organization: 6WIND Message-ID: <3b916ec7-3aca-13a7-7a48-7a7e8822e488@6wind.com> Date: Fri, 26 Jan 2018 00:34:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180125233043.66ff08c2@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 25/01/2018 à 23:30, Jiri Benc a écrit : > On Thu, 25 Jan 2018 15:20:59 +0100, Nicolas Dichtel wrote: >> Hmm, I don't agree. For me, it would be the correct answer. If user has a socket >> in ns_a and targets a RTM_GETLINK in ns_b, the answer he gets should be like if >> it was done in ns_b. > > But that information would be useless for the caller. Why return a > value that has no meaning for the caller and can not be used? More so > when the kernel is aware of what the correct meaningful value is? Why meaningful? The user knows that the answer is like if if was done in another netns. It enables to have only one netlink socket instead of one per netns. But the code using it will be the same. I fear that with your approach, it will results to a lot of complexity in the kernel. > >> This is already the case with messages received with NETLINK_LISTEN_ALL_NSID, >> there is no reason to do something different. > > NETLINK_LISTEN_ALL_NSID is tough due to way it is implemented. But yes, > it should translate the netnsids to be valid in the socket's netns. > That's the only sane way for the listener. A listener that uses this option should know the details about each netns it listens. Thus, he has no problem to interpret the answer. What is really missing for me, is a way to get a fd from an nsid. The user should be able to call RTM_GETNSID with an fd and a nsid and the kernel performs the needed operations so that the fd points to the corresponding netns. Nicolas