From: Ben Greear <greearb@candelatech.com>
To: Denis Kenzior <denkenz@gmail.com>, linux-wireless@vger.kernel.org
Subject: Re: NL80211_SCAN_FLAG_RANDOM_ADDR ?
Date: Thu, 11 Apr 2019 19:15:02 -0700 [thread overview]
Message-ID: <56af141b-80c4-4256-21d5-cb6c39a327e8@candelatech.com> (raw)
In-Reply-To: <ce4f4f2b-ad34-fbf6-6fcb-0b95cf9b9d24@gmail.com>
On 04/11/2019 06:26 PM, Denis Kenzior wrote:
> Hi Ben,
>
> On 04/11/2019 06:20 PM, Ben Greear wrote:
>> On 4/11/19 4:19 PM, Ben Greear wrote:
>>> On 4/11/19 3:30 PM, Denis Kenzior wrote:
>>>> 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 :)
>>>
>>> You can be sure that each driver/hardware has its own bugs and limitations related to this.
>>>
>>> Ath10k wave 1 and wave 2 that I am aware of would ignore and/or not ACK probe responses
>>> sent back to an MAC address that is not that of the station itself. And changing the mac of a station
>>> would require complete re-association AFAIK. That is likely just one of the many issues.
>
> Yes, I understand that some hardware would not support this. But the question is does this check belong at the nl80211 layer (e.g. no hardware can do this) vs somewhere at the driver layer + additional feature bit as needed.
>
>>
>> I should add: If you really want to scan in this manner, you could just create a new station vdev with
>> random addr and have it do the scanning, then delete it when done? The original station will continue on
>> its way unmolested.
>>
>
> So you mean something like:
> sudo iw phy0 interface add sta2 type station
> sudo iw dev sta2 scan randomize
> command failed: Network is down (-100)
> sudo ifconfig sta2 up
> SIOCSIFFLAGS: Device or resource busy
>
> I guess I'm running into this:
>
> valid interface combinations:
> * #{ managed } <= 1, #{ AP, P2P-client, P2P-GO } <= 1, #{ P2P-device } <= 1,
> total <= 3, #channels <= 2
>
> Or did you mean something else?
You got my meaning, I guess your driver cannot support it. It should work with ath10k,
at least the versions I use.
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
next prev parent reply other threads:[~2019-04-12 2:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2019-04-12 9:26 ` Sergey Matyukevich
2019-04-12 15:00 ` Denis Kenzior
2019-04-12 21:21 ` Arend Van Spriel
Reply instructions:
You may reply publicly 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=56af141b-80c4-4256-21d5-cb6c39a327e8@candelatech.com \
--to=greearb@candelatech.com \
--cc=denkenz@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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox