Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp931958ybx; Tue, 5 Nov 2019 07:44:54 -0800 (PST) X-Google-Smtp-Source: APXvYqx2aAckoIM8A6budbv//1d/ZpWQfmVN802iX0BbMdFxTImYD6iRLFBj6ceaFHr+gg4JYgKQ X-Received: by 2002:a17:906:7399:: with SMTP id f25mr13988170ejl.176.1572968694362; Tue, 05 Nov 2019 07:44:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572968694; cv=none; d=google.com; s=arc-20160816; b=0P01mzWabehecLKkDLGpYScrYz4VF0SaI+dCpbZbiMRRGwLNDkQK6z9CGrCq/SKF7+ otS3OO/X5uX4yzvzVxfXnb/v4wTMcF26rM+gI7a11e6e3hAXG/c5vleqU0Vou1Q/2jhr a7IJLwW1Ju+MVsr2qzU4js/hDPKixMFcTpUuazxEC5T3APwrM4YpDJtEJehaW2nBDsDp 77AcA/LrZwVwglwLLoFFUfjE/DZZGtLXedaKzJQXOzHKPdyCqvpIDwmYE4d14Vg0b516 t4cgOKG1ksCClOxV61X1N6f7D4VFIrDxpvLicuZz1Upw3glii62UhwZiF0mPVMOBOgvv iEiA== 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:references:cc:to:subject:reply-to :dkim-signature; bh=Ws7Hi7hEPlrtiokvvL54ucIv+PnQC8Xef+cIaeLnl+Y=; b=WfVr2R1TJeLfNlcyth4DpwvVmbNY7Q2KPqCpma34Z8lSwvT0/mOagQKBgLhC4uKA73 to4vsNCNOwmhZJq/Qx5/rqLdsRXTWYXMYxT/+vV7Mri3sImR38+/efW0MCSzObw0GImg NtYE66c6toLI7o8YG7Au9oZu9u0P2GxqkeVyz9skPBpvMGHDohU+X1+9UyX12CCS1nXr d81KIlYojYJYB3E4n5wPTrOU8fOCw3a0+xvNpiXPO8cO6GwNld9FV5sZO/98c8Fy0XN3 rTLWamtfR5jTvL8vuFP0mcN0m1iXSmq7qlGIJNO1wiE8U02OwA0s7BZwnm2Dhl0W4mCc 5hFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@6wind.com header.s=google header.b=LMu9XN7u; 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 qh13si3911394ejb.407.2019.11.05.07.44.30; Tue, 05 Nov 2019 07:44:54 -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 header.s=google header.b=LMu9XN7u; 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 S2389799AbfKEPnX (ORCPT + 99 others); Tue, 5 Nov 2019 10:43:23 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:54012 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728399AbfKEPnW (ORCPT ); Tue, 5 Nov 2019 10:43:22 -0500 Received: by mail-wm1-f66.google.com with SMTP id x4so10356551wmi.3 for ; Tue, 05 Nov 2019 07:43:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=reply-to:subject:to:cc:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Ws7Hi7hEPlrtiokvvL54ucIv+PnQC8Xef+cIaeLnl+Y=; b=LMu9XN7uvY5qrZDnV8kRjWDJ537EgUXUoDl579SrxOZJaFeLE96BI6nl4KBh2eDSZO nhAY+G32tR/D9wPOVWENEBxcPbtmLLiM0v4Lig3OHLZsp5loSG0l1mOIeYgVnzMoTTyA 9cY32QkuSX7sYyWCH9yhBl3RDeL7YBwlga7ZelJGJqLvI0cg0xc4/GNPkU5kmil8oqym 9UbQmpACO1EGBkDCphF4+eE+Hrut7ktbSaWtM3ZOJdChZfnJFOfjJiHC/h7nBFB4OvRl j5Ns+zeLWcS8Xr5NUCO6WXh5b87zqda3+t0Aau69yevRzynlpd46D5b41KSP9P0P0dOa 6zOQ== 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:to:cc:references:from :organization:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=Ws7Hi7hEPlrtiokvvL54ucIv+PnQC8Xef+cIaeLnl+Y=; b=D9v7iohdfL2eRVH4z5Cg7V/GGMYTPISRwcKu3R/m+H1VvxOypqMogZgour/mLqXq9c P3+F/rRxdsWweNlXb7BQCrHIA/GtWo35vuX8VNsxsJmKw6wFKzuZKtt8qFSVzxlDDrS6 dmknI/pdq2d9/ZdusvTftb+R7k/1QtujOeM2hWWb7vu3qCe4mpqCabWu3echnNKf/CAm klwuzGzXrChhnE8DGSnuGMpWdgzO2RA3qLhGNsrvEuWTGGLGouCnsBJ/I9PbBeTa00UB UOqICN9ejBvWpQ4Z7+nvh8/uE9bG/mOu435isHn3q7qa9unHOdLt6KIB7FOeFJITMOJq 8V2w== X-Gm-Message-State: APjAAAX3X5qePC75K856Jz9NS21t27+8XCYTECD0BedN76jgFCOCpnH/ UyP/xgoSXOjPOR66GPEhUaxCUQ== X-Received: by 2002:a1c:2e8f:: with SMTP id u137mr4888123wmu.105.1572968599564; Tue, 05 Nov 2019 07:43:19 -0800 (PST) Received: from ?IPv6:2a01:e35:8b63:dc30:f096:9925:304a:fd2a? ([2a01:e35:8b63:dc30:f096:9925:304a:fd2a]) by smtp.gmail.com with ESMTPSA id b3sm13269134wmj.44.2019.11.05.07.43.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Nov 2019 07:43:18 -0800 (PST) Reply-To: nicolas.dichtel@6wind.com Subject: Re: [PATCH 3/5] rtnetlink: allow RTM_NEWLINK to act upon interfaces in arbitrary namespaces To: Jonas Bonn , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: davem@davemloft.net References: <20191105081112.16656-1-jonas@norrbonn.se> <20191105081112.16656-4-jonas@norrbonn.se> From: Nicolas Dichtel Organization: 6WIND Message-ID: Date: Tue, 5 Nov 2019 16:43:18 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191105081112.16656-4-jonas@norrbonn.se> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 05/11/2019 à 09:11, Jonas Bonn a écrit : > RTM_NEWLINK can be used mostly interchangeably with RTM_SETLINK for > modifying device configuration. As such, this method requires the same > logic as RTM_SETLINK for finding the device to act on. > > With this patch, the IFLA_TARGET_NETNSID selects the namespace in which > to search for the interface to act upon. This allows, for example, to > set the namespace of an interface outside the current namespace by > selecting it with the (IFLA_TARGET_NETNSID,ifi->ifi_index) pair and > specifying the namespace with one of IFLA_NET_NS_[PID|FD]. > > Since rtnl_newlink branches off into do_setlink, we need to provide the > same backwards compatibility check as we do for RTM_SETLINK: if the > device is not found in the namespace given by IFLA_TARGET_NETNSID then > we search for it in the current namespace. If found there, it's > namespace will be changed, as before. > > Signed-off-by: Jonas Bonn Acked-by: Nicolas Dichtel