Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp663684ybz; Wed, 29 Apr 2020 07:15:32 -0700 (PDT) X-Google-Smtp-Source: APiQypK4Lykb5IXdwCLmKaLW3606+fcPV0w5STCB2EnpwRIPktwPQb5+n4nQQGvm/sLaWLEQ4qWX X-Received: by 2002:a17:907:7246:: with SMTP id ds6mr2578484ejc.203.1588169732253; Wed, 29 Apr 2020 07:15:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588169732; cv=none; d=google.com; s=arc-20160816; b=IsICVsRSCjDCVNbnzMBeVGrjzVQhRvLPu1+kXuApSvKL7sDrzR3b4eMLEss+H/5uB/ VaeK2TM4Tf5UMgWQFZ3XIzs8HfQhwpQSfXxrv92EzzctZAKv214x8fAPpsVFzgCRJFSf Rc46KZ68PdsAOefpyxlsiXft/pA82J4b+ys9p82mVB3qxgcBUoZ1p1glhfkq5WaC+IuJ E2puhI+r9OR8nZ/7dcUoGYck70MCHZgxlMJ+Vh9qq8Kn2ZYnwwRnmTJuyup7l2n8DkLY UWuEuaz3nl6b1PYqD4NyN2/VyI5YTh+g6fu/7JfixbsUMkNtJP9jkm6ofB5Rq36RPzcK MQCA== 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:cc:to:from:subject :message-id; bh=JVww1/mi1h2D9OJ8fcqBIEzHgIEvocE8JYzHRPcebqY=; b=EbTBw54rXjGZeDIAHKMGE9IAu9PTgObhwzOQT1uC4JBtsYGTikPjC64cQGAg4eWXM0 Amel3WpoiiGIQvJ26UlEnzXxUkZqr5EdMAHbc9Yja7zEdMkgyT+nxKOWOADzIWNFFigJ 7+7kBMvRQDFkHcLlJXnb5saVrj+IXpju4ybtD3PzMVY7jn53EjOOJ9ZB3AUBrT1k63Ir ZOJ+cgP83BBbFb7dbJ4DFWzBsj5aFERVyrIN6PPCiNzEb4mFIPRzfvGGPFzNk6j0qpI9 /yWB9cS8tD2eGIkr5yXpTtYgMuoM8ojtJVizV0IucDH8jHZyldjlJtAuxUKhVCIfsXBg B9Dg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c7si3928513ejx.28.2020.04.29.07.15.06; Wed, 29 Apr 2020 07:15:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726963AbgD2OO6 (ORCPT + 99 others); Wed, 29 Apr 2020 10:14:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726516AbgD2OO6 (ORCPT ); Wed, 29 Apr 2020 10:14:58 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8F5CC03C1AD for ; Wed, 29 Apr 2020 07:14:57 -0700 (PDT) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) (envelope-from ) id 1jTnUG-001wZ3-5h; Wed, 29 Apr 2020 16:14:56 +0200 Message-ID: Subject: Re: [PATCH 1/5] mac80211: Random MAC address for a Management frame exchange From: Johannes Berg To: Jouni Malinen Cc: linux-wireless@vger.kernel.org Date: Wed, 29 Apr 2020 16:14:54 +0200 In-Reply-To: <20200425155713.25687-1-jouni@codeaurora.org> References: <20200425155713.25687-1-jouni@codeaurora.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) 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 On Sat, 2020-04-25 at 18:57 +0300, Jouni Malinen wrote: > +++ b/net/mac80211/offchannel.c > @@ -955,6 +955,12 @@ int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, > IEEE80211_SKB_CB(skb)->hw_queue = > local->hw.offchannel_tx_hw_queue; > > + /* remember a random MAC address for Management frame exchange */ > + if (wiphy_ext_feature_isset(wiphy, > + NL80211_EXT_FEATURE_MGMT_TX_RANDOM_TA) && > + !ether_addr_equal(mgmt->sa, wdev_address(wdev))) > + memcpy(local->mgmt_tx_rand_addr, mgmt->sa, ETH_ALEN); > + > /* This will handle all kinds of coalescing and immediate TX */ > ret = ieee80211_start_roc_work(local, sdata, params->chan, > params->wait, cookie, skb, This feels wrong to me. It seems it should be made part of the roc work item, and only copied over when that item actually starts, and also used to not coalesce different items if they specify conflicting temporary addresses. > @@ -971,6 +977,9 @@ int ieee80211_mgmt_tx_cancel_wait(struct wiphy *wiphy, > { > struct ieee80211_local *local = wiphy_priv(wiphy); > > + /* stop using the random MAC address for Management frame exchange */ > + eth_zero_addr(local->mgmt_tx_rand_addr); > + > return ieee80211_cancel_roc(local, cookie, true); Similar here, not clear that the ROC item even started yet at this point. It seems to me it needs to be pushed a layer deeper, say into ieee80211_handle_roc_started() and ieee80211_offchannel_return() or so. johannes