Received: by 10.223.176.46 with SMTP id f43csp2214087wra; Thu, 25 Jan 2018 06:39:43 -0800 (PST) X-Google-Smtp-Source: AH8x226i5iD8ves3djLlp7n7v7Kkqb3iDkRQN2wPD4C1DiLN1/QeQ7I7Xy5Zjn7Zic1A6DFBG7Kh X-Received: by 2002:a17:902:8f98:: with SMTP id z24-v6mr11799939plo.311.1516891183217; Thu, 25 Jan 2018 06:39:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516891183; cv=none; d=google.com; s=arc-20160816; b=W/CHS/Mrx1exHWJTADEGQI+l7KRFYv+s3viPKbE/BxPLimJX3cv3JasmY6YFozj7n/ MB0LaWxTZdarZf5UbXoCacQaHNR8rttbqmcyZz65hsidf2tbzrFCGDQel1a4vxPWJTKA caUZuEXzV4gpyAzaj+fM0RFQ3PlgcYG4T6hyYVs955mlyAicm1dR1Vr5gM0AcoNMPVvL L3DUei23YU5y/jRaLTNSO8nXDdNEjTTxhGIwlGxtqgmOTy2XJnU8+GalgbFqluhddwpt fhoS9Qxt/xhdrEiyzqg8ffGANrFMjM3e2CUDmKuYxeoIDhHNRfkMysM2YCfMc6i/Hgtx i/6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:cc:to:references:subject:reply-to :dkim-signature:arc-authentication-results; bh=rWu960iO/ChN7ccYgIWMcIAegijbeQ4rg92iVsFVv2E=; b=z0p+p4myH8f+Pi/LcNlm3uhOYQGWinvVxve97AZJjlwGnpheTSl+PCAkqUtPPv9pmm flX7icofWURytDDMk1lGaacp/pR1LhGqqtn80Fkm1kDfI77mAoj9Xw+ICldUDhq7jNby RVWHh55EZh59CHAYQvuWSVRqTNLSkAWORtDtR3qlw0Y+TCVZ7a5qvlJLic/6Xc8gpQaM C/yMv3JEoJybdQO/2zAJNZlfSlfGAWrM3g8Y+11i0Lz3PtNF1Ue1eK8q/2Ik96FL6kgL 6YCXPzXmfe9dHoiO6DgUgyNhP3alr9Hq6zuQQ79bCAl/2Ucf2zsrs3AvevUue6EhQSXd ypbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@6wind-com.20150623.gappssmtp.com header.s=20150623 header.b=auwDM9pM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f13si1630000pgr.725.2018.01.25.06.39.28; Thu, 25 Jan 2018 06:39:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@6wind-com.20150623.gappssmtp.com header.s=20150623 header.b=auwDM9pM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751442AbeAYOVH (ORCPT + 99 others); Thu, 25 Jan 2018 09:21:07 -0500 Received: from mail-wm0-f41.google.com ([74.125.82.41]:38504 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751429AbeAYOVG (ORCPT ); Thu, 25 Jan 2018 09:21:06 -0500 Received: by mail-wm0-f41.google.com with SMTP id 141so15145629wme.3 for ; Thu, 25 Jan 2018 06:21:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=reply-to:subject:references:to:cc:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=rWu960iO/ChN7ccYgIWMcIAegijbeQ4rg92iVsFVv2E=; b=auwDM9pM3bCSe6hJE3I3xh97+6qiqunmC/BUakV9mzvPlV0FQNJAtYrA75IqGs/yAW RA11PM4o8Qn9hqjPzNC8oNMZhSVU8LmQ2rk2OtypOk+oMAeAsK1IlvUMX4ROjaHSrQYi BBaifLm+WFy9F9ZsgmMOyO9WBn3wRFpR8GzmiHfhrul6omEOpJPIDEJzbIy1Id8lXk1U rKG1hTnWymyQbp391kngaoUdWL/TvQP4KRXZ83NAEKFiXQgoEvbymNGJTWORl/m5sWPb TV+3BjNj+zeFsc6TTVQpXscm7jWQlKu+8ySqjmF6WNMkfmY90FTENBvzQvGR91skIOUa 9whw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:references:to:cc:from :organization:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=rWu960iO/ChN7ccYgIWMcIAegijbeQ4rg92iVsFVv2E=; b=ptM347J/lGJ80yYt0lbwwBsFNdAyCja4+OxIoR18diLxvsyvBee9oFIJr23ggRAuAS KBgIrfbgPanBw/fzEo592eQr2tfC/K2JgNW5pJHYtDktsbrqv0kxgvfotHrhNcAOGuY2 C5oK2ONZmxXyJ1Ep4f0p9CswEw1v6mAJwvB03uMKez2nCbJUFI0uu3KLSm77IzKwN58E YthqEhgIngwbve15CFqZQsaxptFLRzWhj8jtQvR0ppH04W7rYJHvGn13eTlGu9MsVYIh SLKGvJwyhP6EF8C7jg+SqGLpicbagDQcedwe0PLhcfDPMsCmE262UzSYDp2GLckCL5sN rRZQ== X-Gm-Message-State: AKwxytd0RKzd28EuxHdy2hutX4Ma8wsf8Dls+904GbzT5yXbMI+QdIFu LwP9kuOdFg//Uwgaussxki54XA== X-Received: by 10.28.227.70 with SMTP id a67mr5241179wmh.46.1516890064741; Thu, 25 Jan 2018 06:21:04 -0800 (PST) Received: from ?IPv6:2a01:e35:8b63:dc30:c358:2e43:4ca8:894a? ([2a01:e35:8b63:dc30:c358:2e43:4ca8:894a]) by smtp.gmail.com with ESMTPSA id 204sm1679912wmx.0.2018.01.25.06.21.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jan 2018 06:21:02 -0800 (PST) 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> 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: Date: Thu, 25 Jan 2018 15:20:59 +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: <20180124173515.5ae2bc05@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 24/01/2018 à 17:35, Jiri Benc a écrit : > On Wed, 24 Jan 2018 16:24:34 +0100, Nicolas Dichtel wrote: >> I wonder if it would be possible to do something in the netlink framework, like >> NETLINK_LISTEN_ALL_NSID. >> Having some ancillary data at the netlink socket level and a function like >> nlsock_net() (instead of sock_net()) to get the corresponding netns. >> With that, it would be possible, in a generci way, to support this feature for >> all netlink family. > > I'm not sure it's worth the effort to do that in the framework. You'll > need modifications all the way down to the code that generates the > attributes anyway. > > It's not enough to just specify that the operation should be done on a > different netns and hide that from the handlers. Take for example the > existing RTM_GETLINK. Let's say it's executed from within ns_a and > targeted to ns_b (thus IFLA_IF_NETNSID = netnsid of ns_b). Now, if > there's a veth interface in ns_b whose other end is in ns_c, there will > be IFLA_LINK_NETNSID attribute in the response. But the value has to be > netnsid of ns_c as seen from *ns_a*. If you just pretended to switch to > ns_b before invoking rtnl_getlink, it would be netnsid of ns_c as seen > from ns_b which would be wrong. 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. This is already the case with messages received with NETLINK_LISTEN_ALL_NSID, there is no reason to do something different. Regards, Nicolas