Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4803268ybp; Mon, 7 Oct 2019 14:18:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqwtXunmdvBIylkHL01M6Wrt1Mrx3yNuserqIKZvwESeYj6pmK9Gce7MwoYnoEFSFL5a8jRk X-Received: by 2002:a17:906:6bd5:: with SMTP id t21mr26036001ejs.128.1570483114300; Mon, 07 Oct 2019 14:18:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570483114; cv=none; d=google.com; s=arc-20160816; b=x2vresmhI1xsNLaK/IbUiTvW5JRfKdNLTmpQQAMMaX2BSlFWPzAD67nVrcy9cv5rpM HeutEdiqy5k8du9pWA8UlRpUmnIvFwHSCiJpajcHU6O/fUXKFe1pCjbXLAmh/4i/U+dG 2jxj4kvy1POyAzR5hwsVWmtOQsszE1mHIFKmwyvcJBXfd4W4m6YE264MCaC/8di5bN6D xspGGTPCOcRjjSOdqwcl3UclCnc7tioaHmIlWmZVt1XXVSi85GJ6A7akdG0MJ5ed3cob OC9RyXZs4Gr4sUXKjArhXDbtdlmvyO55H/CQEcl7PX1THOcE91zZo9aEpmCxVYowcx4i oZLw== 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 :user-agent:references:in-reply-to:date:to:from:subject:message-id; bh=8R5jAY9Rpk8b7eVxNg/+wRgCEnpKbKnvwGI3nTAShSQ=; b=b9WR9YUwsimeud1UrBtc+aoYXzqaB28E0hbix7/eKmDvfDq8jaSr5m6ClBli6CCCyn IvioZ9hmdJZOpoQ2AzAGbK8iQqEpGfUsUnye+okAUm+ovu2SSHoWFpir2/Th4x/aO7FQ JCc3hoJC5UZM3yl4l76HfvHH7VPGZbc+9rUHml6yoJF2T9u6Gdb8sHj3pRRP6fVYOriz l+FXDgMp/Bbpqje7FZKMLTDtw8Z0N1RFdCmaEXcilxrKBINIFkcp/Az/9qs+9VT2hkb2 udURlwvbfhi954NN0RTg0eBH0uIB9dh7U8QUIwVyZrDeMm67xwDDR5QpSuGc09gqhU/M 3Www== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-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 u12si7967132ejt.21.2019.10.07.14.18.09; Mon, 07 Oct 2019 14:18:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-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-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728723AbfJGVQX (ORCPT + 99 others); Mon, 7 Oct 2019 17:16:23 -0400 Received: from s3.sipsolutions.net ([144.76.43.62]:46922 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728330AbfJGVQX (ORCPT ); Mon, 7 Oct 2019 17:16:23 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.92.2) (envelope-from ) id 1iHaMf-0001nD-Mv; Mon, 07 Oct 2019 23:16:21 +0200 Message-ID: Subject: Re: [PATCH 2/2] mac80211: Support LIVE_ADDRESS_CHANGE feature From: Johannes Berg To: James Prestwood , linux-wireless@vger.kernel.org Date: Mon, 07 Oct 2019 23:16:20 +0200 In-Reply-To: <0b57c1288016310050ccd6233dda886fc4a89b02.camel@gmail.com> (sfid-20191004_184518_081867_8D6E941B) References: <20190913195908.7871-1-prestwoj@gmail.com> <20190913195908.7871-2-prestwoj@gmail.com> (sfid-20190913_220113_985031_7C3A66BD) <90ae00044bc0834d87d3f9fb75ce63dce4cfadd5.camel@gmail.com> <0b57c1288016310050ccd6233dda886fc4a89b02.camel@gmail.com> (sfid-20191004_184518_081867_8D6E941B) Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Hi, > > > If you do care about this being more granular then you should check > > > *which* interface is scanning, and then you can still switch the > > > MAC > > > address for *other* interfaces - but I'd still argue it should be > > > independent of interface type. > > So yes these can scan, but this should be covered by the > netif_carrier_ok check which is done first. Not sure what you mean by that. You could have two interfaces, one which is scanning right now, right? And then theoretically you don't care about the other one - it *should* be OK to remove/re-add (with new MAC address) the one that *isn't* scanning, right? But we don't have that granularity here for anything - you're just checking "sdata->local->something", and by going from sdata to local you've now checked the whole NIC, not just a single interface on that NIC. Which is fine, no complaint from me, just in that case you end up failing when really there isn't much need to fail. In fact, in a case like this, actually clearing IFF_UP, changing address and setting IFF_UP would work, concurrently with another interface scanning. > We can just remove the > switch entirely, but the roc_list/scanning check only matters for > station/p2p_client so checking for the other interface types is kinda > pointless and redundant. But it's also completely confusing to do it this way because you go from "sdata" to "local", and at that point the data that you're working on is no longer specific to that one interface, it's actually for the whole NIC. Basically what I'm saying is this: it's confusing and makes no sense to do something like if (this_is_a_certain_netdev_type) check_some_global_data(); > Also I am not sure what you mean by *which* interface. This function is > called on a single interface, so checking what other interfaces are > doing seems strange... My point exactly - but that's what you're doing here in the code. Now I think perhaps without even realizing? johannes