]> git.baikalelectronics.ru Git - kernel.git/commit
wifi: mac80211: Support POWERED_ADDR_CHANGE feature
authorJames Prestwood <prestwoj@gmail.com>
Fri, 26 Aug 2022 17:00:32 +0000 (10:00 -0700)
committerJohannes Berg <johannes.berg@intel.com>
Sat, 3 Sep 2022 15:01:04 +0000 (17:01 +0200)
commitf984bb19d59447e62347a5142c9d1dde9888689a
tree525d3fb82cd9a9a16b40ed6538a2badc29b4ad31
parent9a79f9c0f732928f3dd453cdd3c15639ff624a4f
wifi: mac80211: Support POWERED_ADDR_CHANGE feature

Adds support in mac80211 for NL80211_EXT_FEATURE_POWERED_ADDR_CHANGE.
The motivation behind this functionality is to fix limitations of
address randomization on frequencies which are disallowed in world
roaming.

The way things work now, if a client wants to randomize their address
per-connection it must power down the device, change the MAC, and
power back up. Here lies a problem since powering down the device
may result in frequencies being disabled (until the regdom is set).
If the desired BSS is on one such frequency the client is unable to
connect once the phy is powered again.

For mac80211 based devices changing the MAC while powered is possible
but currently disallowed (-EBUSY). This patch adds some logic to
allow a MAC change while powered by removing the interface, changing
the MAC, and adding it again. mac80211 will advertise support for
this feature so userspace can determine the best course of action e.g.
disallow address randomization on certain frequencies if not
supported.

There are certain limitations put on this which simplify the logic:
 - No active connection
 - No offchannel work, including scanning.

Signed-off-by: James Prestwood <prestwoj@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/iface.c
net/mac80211/main.c