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

wiphy: Switch to CamelCase for mac_randomize_bytes

This commit is contained in:
Denis Kenzior 2019-10-25 11:16:28 -05:00
parent b3c08da45b
commit 8d0860ef86

View File

@ -1166,16 +1166,12 @@ static int wiphy_init(void)
{ {
struct l_genl *genl = iwd_get_genl(); struct l_genl *genl = iwd_get_genl();
const struct l_settings *config = iwd_get_config(); const struct l_settings *config = iwd_get_config();
const char *s = l_settings_get_value(config, "General",
"mac_randomize_bytes");
const char *whitelist = iwd_get_phy_whitelist(); const char *whitelist = iwd_get_phy_whitelist();
const char *blacklist = iwd_get_phy_blacklist(); const char *blacklist = iwd_get_phy_blacklist();
const char *s;
nl80211 = l_genl_family_new(genl, NL80211_GENL_NAME); nl80211 = l_genl_family_new(genl, NL80211_GENL_NAME);
if (s && !strcmp(s, "nic"))
mac_randomize_bytes = 3;
/* /*
* This is an extra sanity check so that no memory is leaked * This is an extra sanity check so that no memory is leaked
* in case the generic netlink handling gets confused. * in case the generic netlink handling gets confused.
@ -1204,6 +1200,18 @@ static int wiphy_init(void)
if (blacklist) if (blacklist)
blacklist_filter = l_strsplit(blacklist, ','); blacklist_filter = l_strsplit(blacklist, ',');
s = l_settings_get_value(config, "General",
"AddressRandomizationRange");
if (s) {
if (!strcmp(s, "nic"))
mac_randomize_bytes = 3;
else if (!strcmp(s, "full"))
mac_randomize_bytes = 6;
else
l_warn("Invalid [General].AddressRandomizationRange"
" value: %s", s);
}
return 0; return 0;
} }