Received: by 10.223.176.46 with SMTP id f43csp969347wra; Wed, 24 Jan 2018 08:36:30 -0800 (PST) X-Google-Smtp-Source: AH8x227oM7XXdZh8dQdPDfGaX8miU7ikzA3GECaBl7XJFJiOkW5vsaeR3c+x1xtUQUd/JQ02aJ7g X-Received: by 10.98.57.27 with SMTP id g27mr13676245pfa.128.1516811789900; Wed, 24 Jan 2018 08:36:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516811789; cv=none; d=google.com; s=arc-20160816; b=XRl5qQ0/ordoFRbIKc/WIewOyIFPB7Vlew5O/rcs7ZYeggHNEPeuGx5S/Wb6Bhf5yd oVetBSVmlxsRqqz46gCCQ2B0HN6b8FJRSU/Z97XltBj70O3tQ4h/qSFeTjk6quBSRYFt bt/lfjNs+Wt4HfgsfUbrX359WzSJ5R90Y1UFcFi70NLzeStubyMZxw9SFj47asTYqp6R L1Fsxb3ohvXtXkrf+YV6yY//hkm2FScyxfPq5tUHI4HzHgZIrg6o021SnaiORv2bvj2u n41P2yf/wjaIyL7Tfsf1LCZYVUpT0GfQvB29hMbWgtjJyiwERUzBld8LAXmL9tPG8Hld j4pQ== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=06AmAf/uZ9OjZ+vOKUsfbHH62aXJlNiKNVWlzFqv0RU=; b=NKwPFDeczej9KygL/UtqeYxD6sVrC3LT6gE0Fo2NIKXsF//HFWsgKmDZ7vSd1sLSW1 jO9XWhLxwzvVTtKie1NoxbTGZqQHa4ou8VhTDnepXa0M0nFCrgQ8QBWuhppmxZ62nGWJ NEOP70LkohoEm7xUbdSIylIbyqu8HxxU6dw/I0VCRG3IgXvV6hjtsikhrk9NGsFtLw8c VZAGXzg8zrz+cbjUmC6NIt2dVTq85fBExtkyVJZkGBI8tzJXx0JFjeGOwu2DtaMASEtp 8EkLYarJGqdQXxrnqYGQIyWpLRE/ZYWSQzDDUlGImuFJ2Kn4ms4bH25LSSVnNsMfE8Ay Qp1A== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w31-v6si426509pla.402.2018.01.24.08.36.16; Wed, 24 Jan 2018 08:36:29 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964944AbeAXQf0 (ORCPT + 99 others); Wed, 24 Jan 2018 11:35:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40554 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964785AbeAXQfY (ORCPT ); Wed, 24 Jan 2018 11:35:24 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BA8C947072; Wed, 24 Jan 2018 16:35:23 +0000 (UTC) Received: from localhost (ovpn-204-31.brq.redhat.com [10.40.204.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 851AE60C89; Wed, 24 Jan 2018 16:35:18 +0000 (UTC) Date: Wed, 24 Jan 2018 17:35:15 +0100 From: Jiri Benc To: Nicolas Dichtel 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 Subject: Re: [PATCH net-next 0/3 V1] rtnetlink: enable IFLA_IF_NETNSID for RTM_{DEL,SET}LINK Message-ID: <20180124173515.5ae2bc05@redhat.com> In-Reply-To: References: <20180124142634.17766-1-christian.brauner@ubuntu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 24 Jan 2018 16:35:24 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. That's why 79e1ad148c844 added the tgt_net stuff. Jiri