3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 13:02:44 +01:00

network: Introduce __bss_is_sae

This takes an rsn_info pointer directly so that some calls to
scan_bss_get_rsn_info can be optimized
This commit is contained in:
Denis Kenzior 2018-11-15 11:29:13 -06:00
parent 3d549e457d
commit c146490567

View File

@ -488,17 +488,23 @@ void network_sync_psk(struct network *network)
network->settings);
}
static bool bss_is_sae(struct scan_bss *bss)
static inline bool __bss_is_sae(const struct scan_bss *bss,
const struct ie_rsn_info *rsn)
{
if (rsn->akm_suites & IE_RSN_AKM_SUITE_SAE_SHA256)
return true;
return false;
}
static bool bss_is_sae(const struct scan_bss *bss)
{
struct ie_rsn_info rsn;
memset(&rsn, 0, sizeof(rsn));
scan_bss_get_rsn_info(bss, &rsn);
if (rsn.akm_suites & IE_RSN_AKM_SUITE_SAE_SHA256)
return true;
return false;
return __bss_is_sae(bss, &rsn);
}
int network_autoconnect(struct network *network, struct scan_bss *bss)