mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-25 09:39:25 +01:00
scan: Add optional source_mac scan parameter
This is similar to randomize_mac_addr_hint but it sets a specific source MAC address for our probe frames.
This commit is contained in:
parent
aa3dc1b953
commit
9335680cd8
12
src/scan.c
12
src/scan.c
@ -361,6 +361,18 @@ static struct l_genl_msg *scan_build_cmd(struct scan_context *sc,
|
||||
*/
|
||||
flags |= NL80211_SCAN_FLAG_RANDOM_ADDR;
|
||||
|
||||
if (!is_passive && params->source_mac &&
|
||||
wiphy_can_randomize_mac_addr(sc->wiphy)) {
|
||||
static const uint8_t mask[6] = /* No random bits */
|
||||
{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
|
||||
|
||||
flags |= NL80211_SCAN_FLAG_RANDOM_ADDR;
|
||||
l_genl_msg_append_attr(msg, NL80211_ATTR_MAC, 6,
|
||||
params->source_mac);
|
||||
l_genl_msg_append_attr(msg, NL80211_ATTR_MAC_MASK, 6,
|
||||
mask);
|
||||
}
|
||||
|
||||
if (!is_passive && wiphy_has_ext_feature(sc->wiphy,
|
||||
NL80211_EXT_FEATURE_SCAN_RANDOM_SN))
|
||||
flags |= NL80211_SCAN_FLAG_RANDOM_SN;
|
||||
|
@ -104,6 +104,7 @@ struct scan_parameters {
|
||||
bool no_cck_rates : 1;
|
||||
bool duration_mandatory : 1;
|
||||
const char *ssid; /* Used for direct probe request */
|
||||
const uint8_t *source_mac;
|
||||
};
|
||||
|
||||
static inline int scan_bss_addr_cmp(const struct scan_bss *a1,
|
||||
|
Loading…
Reference in New Issue
Block a user