Linux wireless drivers development
 help / color / mirror / Atom feed
* NL80211_SCAN_FLAG_RANDOM_ADDR ?
@ 2019-04-11 22:30 Denis Kenzior
  2019-04-11 23:19 ` Ben Greear
  2019-04-12  9:26 ` Sergey Matyukevich
  0 siblings, 2 replies; 8+ messages in thread
From: Denis Kenzior @ 2019-04-11 22:30 UTC (permalink / raw)
  To: linux-wireless

Hi,

I've been poking around at how this flag is used and I noticed this 
check in net/wireless/nl80211.c:

nl80211_check_scan_flags()

         if (*flags & NL80211_SCAN_FLAG_RANDOM_ADDR) {
                 int err;

                 if (!(wiphy->features & randomness_flag) ||
                     (wdev && wdev->current_bss))
                         return -EOPNOTSUPP;


The above disallows the use of RANDOM_ADDR for scans while connected. 
The nl80211.h uapi header seems to concur:

  "@NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR: This device/driver supports 
using a random MAC address during scan (if the device is unassociated);"

However, if I create a P2P Device (in addition to the default STA 
device), the kernel happily lets me scan on the wdev while the STA 
interface is connected.

sudo iw phy0 interface add p2p type __p2pdev
sudo iw wdev 0x2 p2p start
sudo iw wdev 0x2 scan randomize

So the immediate question I have is, should the RANDOM_ADDR flag indeed 
be limited to unassociated STA interfaces?  It would seem the hardware 
is capable randomizing even when connected? Please educate me :)

Regards,
-Denis

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-04-12 21:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-11 22:30 NL80211_SCAN_FLAG_RANDOM_ADDR ? Denis Kenzior
2019-04-11 23:19 ` Ben Greear
2019-04-11 23:20   ` Ben Greear
2019-04-12  1:26     ` Denis Kenzior
2019-04-12  2:15       ` Ben Greear
2019-04-12  9:26 ` Sergey Matyukevich
2019-04-12 15:00   ` Denis Kenzior
2019-04-12 21:21     ` Arend Van Spriel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox