Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2508717ybl; Mon, 19 Aug 2019 03:15:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqzlpeMeV63zldyYu3qIUMBvYj1UlA/QjlT5IgfwX4POLPBy4Q/FUte0Bjh4xDoCHVsN5Cg5 X-Received: by 2002:aa7:8f29:: with SMTP id y9mr24344223pfr.27.1566209720512; Mon, 19 Aug 2019 03:15:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566209720; cv=none; d=google.com; s=arc-20160816; b=KaU+dkCSIVakaBJY+Ogkgu2ZhgOVnrg7bcXPRpQxr20+92F6S87Y0n5ZaophmI+Znf fYYvcEMOKyhUpFJe3AQ1OtmmXS5+ufQzlPrwchNZelL4L/3tlnvHmC0V7bUfO/EXP7Eb 0CTgXbZHqTqLV7w2JXdgqAI15mnkL6UcXr0rZBrLnA7b0CufIk91JyohUtysT4/WYw/3 eF55Z8dU0D4q52+gpQ3dWrrYf2GsKj01IqytjP9ErAwFQFKh8+4Qt9wfvlCOJvmTzPMS YeH/5W+GQeCVTnc3kLsjt4sAO42beBSBONcDRfnzvvAwurw0SJUmOKAfOeflIS7LDGUq UJhQ== 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=qpm3U2BP7gazK4Ai/D9LMDp5qna3UQwwnLTefQ5VUDs=; b=mY8lzZhEonrMuBm41tdGT6w9FEXIPTo98g+a9nRqkZb+wFwm3YMZq0jCXC/rc7IIC1 3W0J64XcWoY0w2rm0Y8L2MLBjCZEcc8skhelqo/Q7aWEDBuyUGEMAxgldPYQ3LdL4A6h yUWhUyiQneZ6m50fCxq3UKwnVuB7wORa0N0wofXPjepqEJQjdrswc6q2wl3IFXN11L/Z 677+jsvlfeAlch4fgVNSkSjD7f4CPAOAS6S/6KuKCig0RxUhwFPA/K6YllYNbrPgSL/y 8FoL2bbD8m9I5Mwd28toe73LDAPrr8P/yfgu/l7qNusgbqMbfQM700pjh8T+iScKAhcO O4YA== 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 go13si9645098plb.297.2019.08.19.03.15.06; Mon, 19 Aug 2019 03:15:20 -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 S1726852AbfHSKOS (ORCPT + 99 others); Mon, 19 Aug 2019 06:14:18 -0400 Received: from s3.sipsolutions.net ([144.76.43.62]:38952 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726550AbfHSKOS (ORCPT ); Mon, 19 Aug 2019 06:14:18 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1hzeg4-0007ec-U2; Mon, 19 Aug 2019 12:14:17 +0200 Message-ID: <645af7dad899e8eb186b3fee0f8a8a151a408557.camel@sipsolutions.net> Subject: Re: [RFC 0/1] Allow MAC change on up interface From: Johannes Berg To: James Prestwood , linux-wireless@vger.kernel.org Date: Mon, 19 Aug 2019 12:14:15 +0200 In-Reply-To: <20190815185702.30937-1-prestwoj@gmail.com> (sfid-20190815_205833_978900_86B1E73D) References: <20190815185702.30937-1-prestwoj@gmail.com> (sfid-20190815_205833_978900_86B1E73D) 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 On Thu, 2019-08-15 at 11:57 -0700, James Prestwood wrote: > This is an example of how a devices MAC address could be changed while > the interface is up. Currently RTNL and mac80211 both require the > interface be down before changing the MAC. > > After poking around a bit I found that some drivers can actually > change the MAC while the iface is up. Allowing user space to do this > while the iface is up would elminate a few potential race conditions > that arise when changing the MAC from user space. > > This commit does a few things: > - Adds an EXT_FEATURE that user space can check to see if the driver > allows this MAC changing. > - Adds a new NL80211_ATTR for including a "random mac" to > CMD_CONNECT. This MAC is passed down the stack and gets set to > the net_device's address. > - Set this wiphy extended feature in iwlwifi (just as an example) > - Relax checks in mac80211 which check if the interface is running > - Set IFF_LIVE_ADDR_CHANGE on net_device. Note: I know setting this > where I did is likely not the right way to do it, but for this > proof-of-concept it works. With guidance I can move this around > to a proper place. It actually seems wrong to set IFF_LIVE_ADDR_CHANGE at all, because you don't actually support that - you only support setting it while not connected? johannes