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
1 changed files with 10 additions and 0 deletions

View File

@ -379,6 +379,8 @@ static struct wiphy_setup_state *manager_rx_cmd_new_wiphy(
struct l_genl_attr attr;
uint32_t id;
const char *name;
bool use_default;
const struct l_settings *settings = iwd_get_config();
if (!l_genl_attr_init(&attr, msg))
return NULL;
@ -425,6 +427,14 @@ static struct wiphy_setup_state *manager_rx_cmd_new_wiphy(
if (whitelist_filter || blacklist_filter)
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:
wiphy_update_from_genl(wiphy, msg);
return state;