Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp793286ybp; Fri, 4 Oct 2019 05:10:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOa9R3t8nepFtKfTR1Wg0RvecKLCdhnzYZkvBhKEP3ywGnCb4y1YqBwleyFIm4WESOuKDa X-Received: by 2002:aa7:cd18:: with SMTP id b24mr14680101edw.181.1570191006807; Fri, 04 Oct 2019 05:10:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570191006; cv=none; d=google.com; s=arc-20160816; b=bjCvbBm9JrfIR2qnCMVZ5fHxgZaBZGfW/4N+Q/c/zPEpMWxhPfhSLK+i5coaIJL187 LQBc4vWGpRINnysIKLr67WzhiE7qBucQ+P/34x0p6F6aKeit02JOvgRqtOvvRyavv+zg tHEnYXsMPxTRuyz7mkYo/9zdZ3fE5J8hy1X1wVDD4t+og5NSdaigHmITCPE7n92M/ktv Ud0Pw1LpoSgPxcoE3dE+m9gylA/PxYHJEJhwDTjpntevVzh5BFHd5YMDNAY//s54pLYU sWPlFI1XCoHFva7HqnGyDMczgSdJsTsmmiXXcXZ3bB8JGSWJ3sFbvqfeDHblTS4mHQBy W8Ow== 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=6eKN5o2coRpP+lLIxkPNsMJDcyXCpqVJ91w70q0f3I0=; b=Wli43v3NLj4E7wea8ta/Q/qGMmnLUEj8koJs23lSxsM6DpEY29T0f9gG6De/cOIAyg v7KSN5RrgxFiL9d3exqsVBYyGuAi+TfQ1rCiEmdcwuPPn+JJgx2GvqY+V8BK1X1boO3G 7vjClDyyAym8R8abTZKhPrZiQXpYqKRRF2K9jeZAuLgQhxrI2B9Q0i+AsNos2wRGppIp 4sCyyjmCrCc7GsWE2tX635uY3dEUZH6wwE0UmGjnO93HCLbK8gXZfeKyHYRzbwb44Nsz 7vzHH/x+2TF1rVfFmmtTVXbybTUM8QIDL9B5oFPtfsNWBMrRT1UzDqaSQN8QG7lCcfGB WSDw== 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 v17si2858831ejq.5.2019.10.04.05.09.40; Fri, 04 Oct 2019 05:10:06 -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 S1729379AbfJDL4z (ORCPT + 99 others); Fri, 4 Oct 2019 07:56:55 -0400 Received: from s3.sipsolutions.net ([144.76.43.62]:38776 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726002AbfJDL4z (ORCPT ); Fri, 4 Oct 2019 07:56:55 -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 1iGMCb-00079s-Od; Fri, 04 Oct 2019 13:56:53 +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: Fri, 04 Oct 2019 13:56:52 +0200 In-Reply-To: <20190913195908.7871-2-prestwoj@gmail.com> (sfid-20190913_220113_985031_7C3A66BD) References: <20190913195908.7871-1-prestwoj@gmail.com> <20190913195908.7871-2-prestwoj@gmail.com> (sfid-20190913_220113_985031_7C3A66BD) 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, I was tempted to apply this (sans the feature advertisement part that I don't think should be in nl80211), but: > > Signed-off-by: James Prestwood Please add a commit log. > +static int ieee80211_can_live_addr_change(struct ieee80211_sub_if_data *sdata) > +{ > + if (netif_carrier_ok(sdata->dev)) > + return -EBUSY; > + > + switch (sdata->vif.type) { > + case NL80211_IFTYPE_AP: > + case NL80211_IFTYPE_P2P_GO: > + case NL80211_IFTYPE_AP_VLAN: > + case NL80211_IFTYPE_WDS: > + case NL80211_IFTYPE_MESH_POINT: > + case NL80211_IFTYPE_MONITOR: > + case NL80211_IFTYPE_OCB: > + /* No further checking required, when started or UP these > + * interface types set carrier > + */ > + break; > + case NL80211_IFTYPE_ADHOC: > + if (sdata->u.ibss.ssid_len != 0) > + return -EBUSY; Can you please document why this is there? Maybe all of the conditions, for that matter. I'm not even entirely sure it _is_ needed - if we've still not created the IBSS but are scanning for it or trying to merge the MAC address won't really matter yet? Probably? > + break; > + case NL80211_IFTYPE_STATION: > + case NL80211_IFTYPE_P2P_CLIENT: > + if (!list_empty(&sdata->local->roc_list) || > + !sdata->local->scanning) > + return -EBUSY; AP, mesh and other interfaces *can* scan, so that test should be pulled out to be generic - but then in fact all of them should probably be generic - ROC maybe can't be done on other interfaces yet, but unless you're going to check *which* interface is actually doing the ROC, you should just make that a generic check that applies to all interfaces. 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. And, I'm confused, but isn't the polarity of the scanning check wrong? johannes