Linux-Wireless Archive on lore.kernel.org
 help / color / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: linux-wireless@vger.kernel.org
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [RFC 0/1] Allow MAC change on up interface
Date: Thu, 15 Aug 2019 11:57:01 -0700
Message-ID: <20190815185702.30937-1-prestwoj@gmail.com> (raw)

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.

James Prestwood (1):
  RFC: allow mac address change on up iface

 .../net/wireless/intel/iwlwifi/mvm/mac80211.c |  2 ++
 include/net/cfg80211.h                        |  1 +
 include/uapi/linux/nl80211.h                  |  3 +++
 net/mac80211/iface.c                          |  5 ++---
 net/wireless/nl80211.c                        |  9 +++++++++
 net/wireless/sme.c                            | 20 +++++++++++++++++++
 6 files changed, 37 insertions(+), 3 deletions(-)

-- 
2.17.1


             reply index

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-15 18:57 James Prestwood [this message]
2019-08-15 18:57 ` [RFC 1/1] RFC: allow mac address change on up iface James Prestwood
2019-08-15 20:48 ` [RFC 0/1] Allow MAC change on up interface Jeff Johnson
2019-08-16  9:56   ` Toke Høiland-Jørgensen
2019-08-19 10:14 ` Johannes Berg
2019-08-19 15:55   ` James Prestwood
2019-08-19 20:20     ` Johannes Berg
2019-08-19 20:58       ` Denis Kenzior
2019-08-20  8:59         ` Johannes Berg
2019-08-20 15:40           ` Denis Kenzior
2019-08-20 17:53             ` Dan Williams
2019-08-20 18:21               ` Denis Kenzior
2019-08-20 18:54                 ` Toke Høiland-Jørgensen
2019-08-20 19:32             ` Johannes Berg
2019-08-20 19:46               ` Denis Kenzior
2019-08-20 20:01                 ` Johannes Berg
2019-08-19 21:14       ` James Prestwood
2019-08-20  6:59         ` Johannes Berg
2019-08-20 19:22           ` Denis Kenzior
2019-08-20 19:43             ` Johannes Berg
2019-08-20 19:58               ` Denis Kenzior
2019-08-20 20:15                 ` Johannes Berg
2019-08-20 20:37                   ` Denis Kenzior
2019-08-20 21:18                     ` Dan Williams
2019-08-20 21:52                       ` Denis Kenzior
2019-08-21  7:21                         ` Johannes Berg
2019-08-20 19:53           ` James Prestwood
2019-08-20 20:06             ` Johannes Berg

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190815185702.30937-1-prestwoj@gmail.com \
    --to=prestwoj@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Wireless Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-wireless/0 linux-wireless/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-wireless linux-wireless/ https://lore.kernel.org/linux-wireless \
		linux-wireless@vger.kernel.org linux-wireless@archiver.kernel.org
	public-inbox-index linux-wireless


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-wireless


AGPL code for this site: git clone https://public-inbox.org/ public-inbox