[Upstream]gsupplicant: Switch to different BSSID of same SSID in case of signal bss... 23/202523/1
authorNiraj Kumar Goit <niraj.g@samsung.com>
Fri, 29 Mar 2019 05:24:53 +0000 (10:54 +0530)
committerNiraj Kumar Goit <niraj.g@samsung.com>
Fri, 29 Mar 2019 05:24:53 +0000 (10:54 +0530)
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 <niraj.g@samsung.com>
gsupplicant/supplicant.c

index 62857e0330b2366582f559c13e90b23ea99d01c3..67d4d608b2e3698e626514820c0c190b8e32f51e 100644 (file)
@@ -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)