3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 22:59:41 +01:00

manager: Add use_default_if setting

If the setting is true we'll not attempt to remove or create
interfaces on any wiphys and will only use the default interface
(if it exists).  If false, force us managing the interfaces.  Both
values override the auto logic.
This commit is contained in:
Andrew Zaborowski 2019-05-02 12:55:21 +02:00 committed by Denis Kenzior
parent 06eb3bbf6a
commit 7bc553e470

View File

@ -379,6 +379,8 @@ static struct wiphy_setup_state *manager_rx_cmd_new_wiphy(
struct l_genl_attr attr; struct l_genl_attr attr;
uint32_t id; uint32_t id;
const char *name; const char *name;
bool use_default;
const struct l_settings *settings = iwd_get_config();
if (!l_genl_attr_init(&attr, msg)) if (!l_genl_attr_init(&attr, msg))
return NULL; return NULL;
@ -425,6 +427,14 @@ static struct wiphy_setup_state *manager_rx_cmd_new_wiphy(
if (whitelist_filter || blacklist_filter) if (whitelist_filter || blacklist_filter)
state->use_default = true; state->use_default = true;
/* The setting overrides our attempts to ensure things work */
if (l_settings_get_bool(settings, "General",
"use_default_interface", &use_default))
state->use_default = use_default;
if (state->use_default)
l_info("Wiphy %s will only use the default interface", name);
done: done:
wiphy_update_from_genl(wiphy, msg); wiphy_update_from_genl(wiphy, msg);
return state; return state;