diff --git a/autotests/testHotspot/autoconnect_test.py b/autotests/testHotspot/autoconnect_test.py index 05ab40ca..36ba92bf 100644 --- a/autotests/testHotspot/autoconnect_test.py +++ b/autotests/testHotspot/autoconnect_test.py @@ -111,7 +111,7 @@ class Test(unittest.TestCase): def setUpClass(cls): IWD.copy_to_hotspot('autoconnect.conf') IWD.copy_to_storage('ssidWPA2-1.psk') - conf = '[General]\ndisable_anqp=0\n' + conf = '[General]\nDisableANQP=0\n' os.system('echo "%s" > /tmp/main.conf' % conf) @classmethod diff --git a/autotests/testHotspot/hessid_test.py b/autotests/testHotspot/hessid_test.py index 13facdcc..f511fd62 100644 --- a/autotests/testHotspot/hessid_test.py +++ b/autotests/testHotspot/hessid_test.py @@ -58,7 +58,7 @@ class Test(unittest.TestCase): @classmethod def setUpClass(cls): IWD.copy_to_hotspot('hessid.conf') - conf = '[General]\ndisable_anqp=1\n' + conf = '[General]\nDisableANQP=1\n' os.system('echo "%s" > /tmp/main.conf' % conf) @classmethod diff --git a/autotests/testHotspot/hotspot_test.py b/autotests/testHotspot/hotspot_test.py index a0c36a3b..0f18fae1 100644 --- a/autotests/testHotspot/hotspot_test.py +++ b/autotests/testHotspot/hotspot_test.py @@ -58,7 +58,7 @@ class Test(unittest.TestCase): @classmethod def setUpClass(cls): IWD.copy_to_hotspot('example.conf') - conf = '[General]\ndisable_anqp=0\n' + conf = '[General]\nDisableANQP=0\n' os.system('echo "%s" > /tmp/main.conf' % conf) @classmethod diff --git a/autotests/testHotspot/roaming_test.py b/autotests/testHotspot/roaming_test.py index a699e1c5..a7274a82 100644 --- a/autotests/testHotspot/roaming_test.py +++ b/autotests/testHotspot/roaming_test.py @@ -58,7 +58,7 @@ class Test(unittest.TestCase): @classmethod def setUpClass(cls): IWD.copy_to_hotspot('roaming.conf') - conf = '[General]\ndisable_anqp=1\n' + conf = '[General]\nDisableANQP=1\n' os.system('echo "%s" > /tmp/main.conf' % conf) @classmethod diff --git a/autotests/testKnownNetworks/frequency_test.py b/autotests/testKnownNetworks/frequency_test.py index 101cfd9a..de040d3e 100644 --- a/autotests/testKnownNetworks/frequency_test.py +++ b/autotests/testKnownNetworks/frequency_test.py @@ -134,7 +134,7 @@ class Test(unittest.TestCase): @classmethod def setUpClass(cls): IWD.copy_to_hotspot('example.conf') - conf = '[General]\ndisable_anqp=0\n' + conf = '[General]\nDisableANQP=0\n' os.system('echo "%s" > /tmp/main.conf' % conf) @classmethod diff --git a/doc/hotspot.txt b/doc/hotspot.txt index 4920095a..b43b0dc6 100644 --- a/doc/hotspot.txt +++ b/doc/hotspot.txt @@ -43,4 +43,4 @@ IWD which allows the user to disable ANQP. As a result, this will also disable any hotspot 2.0 network connections unless the HESSID is provided in the configuration file. By default ANQP will be disabled. It can be enabled with: -disable_anqp=0 +DisableANQP=0 diff --git a/src/station.c b/src/station.c index b1cc0696..315b3dcd 100644 --- a/src/station.c +++ b/src/station.c @@ -57,6 +57,7 @@ static struct l_queue *station_list; static uint32_t netdev_watch; static uint32_t mfp_setting; +static bool anqp_disabled; struct station { enum station_state state; @@ -507,7 +508,6 @@ static bool station_start_anqp(struct station *station, struct network *network, uint8_t anqp[256]; uint8_t *ptr = anqp; struct anqp_entry *entry; - bool anqp_disabled = true; if (!bss->hs20_capable) return false; @@ -516,9 +516,6 @@ static bool station_start_anqp(struct station *station, struct network *network, if (network_get_info(network)) return false; - l_settings_get_bool(iwd_get_config(), "General", "disable_anqp", - &anqp_disabled); - if (anqp_disabled) { l_debug("Not querying AP for ANQP data (disabled)"); return false; @@ -3192,6 +3189,10 @@ static int station_init(void) mfp_setting = 1; } + if (!l_settings_get_bool(iwd_get_config(), "General", "DisableANQP", + &anqp_disabled)) + anqp_disabled = true; + return true; } diff --git a/src/wiphy.c b/src/wiphy.c index 9fbdeddf..cb7dc0e2 100644 --- a/src/wiphy.c +++ b/src/wiphy.c @@ -931,7 +931,7 @@ static void wiphy_set_station_capability_bits(struct wiphy *wiphy) ext_capa = wiphy->iftype_extended_capabilities[NL80211_IFTYPE_STATION]; - if (!l_settings_get_bool(iwd_get_config(), "General", "disable_anqp", + if (!l_settings_get_bool(iwd_get_config(), "General", "DisableANQP", &anqp_disabled)) anqp_disabled = true;