diff options
author | Andrew Zaborowski <andrew.zaborowski@intel.com> | 2020-04-30 15:48:42 +0200 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2020-05-01 11:30:42 -0500 |
commit | c8edd362345e28ad43e5bdba0d167365d7034215 (patch) | |
tree | 3e59e3d7c2ed69d9bc83ca35a0705a4525424866 | |
parent | 270bbbf25abe3b7ce746892f4fdc4e91fdb9ab8a (diff) | |
download | iwd-c8edd362345e28ad43e5bdba0d167365d7034215.tar.gz |
netconfig: Move EnableNetworkConfiguration check to station
Allow p2p to use netconfig even if not enabled for Infrastructure mode
connections.
-rw-r--r-- | src/netconfig.c | 17 | ||||
-rw-r--r-- | src/station.c | 19 |
2 files changed, 18 insertions, 18 deletions
diff --git a/src/netconfig.c b/src/netconfig.c index 1e6af3d26..6a618e8fa 100644 --- a/src/netconfig.c +++ b/src/netconfig.c @@ -1193,28 +1193,11 @@ void netconfig_destroy(struct netconfig *netconfig) static int netconfig_init(void) { - bool enabled; uint32_t r; if (netconfig_list) return -EALREADY; - if (!l_settings_get_bool(iwd_get_config(), "General", - "EnableNetworkConfiguration", - &enabled)) { - if (l_settings_get_bool(iwd_get_config(), "General", - "enable_network_config", &enabled)) - l_warn("[General].enable_network_config is deprecated," - " use [General].EnableNetworkConfiguration"); - else - enabled = false; - } - - if (!enabled) { - l_info("netconfig: Network configuration is disabled."); - return 0; - } - rtnl = iwd_get_rtnl(); r = l_netlink_register(rtnl, RTNLGRP_IPV4_IFADDR, diff --git a/src/station.c b/src/station.c index 3b3bb30a4..c532319a9 100644 --- a/src/station.c +++ b/src/station.c @@ -58,6 +58,7 @@ static struct l_queue *station_list; static uint32_t netdev_watch; static uint32_t mfp_setting; static bool anqp_disabled; +static bool netconfig_enabled; struct station { enum station_state state; @@ -3098,7 +3099,8 @@ static struct station *station_create(struct netdev *netdev) l_dbus_object_add_interface(dbus, netdev_get_path(netdev), IWD_STATION_INTERFACE, station); - station->netconfig = netconfig_new(netdev_get_ifindex(netdev)); + if (netconfig_enabled) + station->netconfig = netconfig_new(netdev_get_ifindex(netdev)); station->anqp_pending = l_queue_new(); @@ -3250,6 +3252,21 @@ static int station_init(void) &anqp_disabled)) anqp_disabled = true; + if (!l_settings_get_bool(iwd_get_config(), "General", + "EnableNetworkConfiguration", + &netconfig_enabled)) { + if (l_settings_get_bool(iwd_get_config(), "General", + "enable_network_config", + &netconfig_enabled)) + l_warn("[General].enable_network_config is deprecated," + " use [General].EnableNetworkConfiguration"); + else + netconfig_enabled = false; + } + + if (!netconfig_enabled) + l_info("station: Network configuration is disabled."); + return 0; } |