From 7bc553e47002496cc47978414f5bbd8ce695adce Mon Sep 17 00:00:00 2001 From: Andrew Zaborowski Date: Thu, 2 May 2019 12:55:21 +0200 Subject: [PATCH] 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. --- src/manager.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/manager.c b/src/manager.c index 3ef8b59a..5920fdd2 100644 --- a/src/manager.c +++ b/src/manager.c @@ -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;