From 85074ce75ce1749e270dc9951d003d4a3c1f9cab Mon Sep 17 00:00:00 2001 From: Niraj Kumar Goit Date: Fri, 29 Mar 2019 10:54:53 +0530 Subject: [Upstream]gsupplicant: Switch to different BSSID of same SSID in case of signal bss removed Teach ConnMan to select the next BSSID when two APs (e.g. 2.4 GHz and 5 GHz) with the same SSID and security configuration are available. Currently when one AP disappears ConnMan will retry to connect to the old AP point even though there is another matching BSSID available. So when wpa_supplicant sends a remove signal we find a matching BSSID and use it even when it's not from the same AP. https://git.kernel.org/pub/scm/network/connman/connman.git/commit/?id=c1debcac758ef1f76a788225679003e2e67d9fdf Change-Id: Ic5ce438addc823ebd0c6bedd2a974f559b33ae25 Signed-off-by: Niraj Kumar Goit --- gsupplicant/supplicant.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c index 62857e03..67d4d608 100644 --- a/gsupplicant/supplicant.c +++ b/gsupplicant/supplicant.c @@ -2788,6 +2788,7 @@ static void interface_bss_removed(DBusMessageIter *iter, void *user_data) GSupplicantNetwork *network; struct g_supplicant_bss *bss = NULL; const char *path = NULL; + bool is_current_network_bss = false; dbus_message_iter_get_basic(iter, &path); if (!path) @@ -2801,6 +2802,7 @@ static void interface_bss_removed(DBusMessageIter *iter, void *user_data) if (network->best_bss == bss) { network->best_bss = NULL; network->signal = BSS_UNKNOWN_STRENGTH; + is_current_network_bss = true; } g_hash_table_remove(bss_mapping, path); @@ -2810,8 +2812,12 @@ static void interface_bss_removed(DBusMessageIter *iter, void *user_data) update_network_signal(network); - if (g_hash_table_size(network->bss_table) == 0) + if (g_hash_table_size(network->bss_table) == 0) { g_hash_table_remove(interface->network_table, network->group); + } else { + if (is_current_network_bss && network->best_bss) + callback_network_changed(network, ""); + } } static void set_config_methods(DBusMessageIter *iter, void *user_data) -- cgit v1.2.3