commit 8d0860ef86a0bc1e3b8ce35e944ad29e03b1c1e3
parent b3c08da45b34da81c24aad03321c4764a380b830
Author: Denis Kenzior <denkenz@gmail.com>
Date: Fri, 25 Oct 2019 11:16:28 -0500
wiphy: Switch to CamelCase for mac_randomize_bytes
Diffstat:
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/src/wiphy.c b/src/wiphy.c
@@ -1166,16 +1166,12 @@ static int wiphy_init(void)
{
struct l_genl *genl = iwd_get_genl();
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 *blacklist = iwd_get_phy_blacklist();
+ const char *s;
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
* in case the generic netlink handling gets confused.
@@ -1204,6 +1200,18 @@ static int wiphy_init(void)
if (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;
}