diff options
author | Maneesh Jain <maneesh.jain@samsung.com> | 2016-12-22 18:30:28 +0530 |
---|---|---|
committer | Maneesh Jain <maneesh.jain@samsung.com> | 2017-01-08 23:35:39 -0800 |
commit | 77076d221356867d576bba8084614f1b15700597 (patch) | |
tree | 4365d814ba30ea2915e9f0a8471dab61358c0b22 /plugins | |
parent | e2224351c2934d63d8e944b69e572a99db209919 (diff) | |
download | connman-77076d221356867d576bba8084614f1b15700597.tar.gz connman-77076d221356867d576bba8084614f1b15700597.tar.bz2 connman-77076d221356867d576bba8084614f1b15700597.zip |
[connman]: Fixed: ConnMan keep trying connection infintely
Description : In following use case, ConnMan was stuck in
auto-connection with a specific AP. In that time, user
could not be able to select any other AP for connection.
1. Connect with an AP
2. Add the Device Mac address in AP's Mac filter list
3. Device disconnect from AP
4. Device keep trying to connection with AP
Partially added following upstream patch.
"http://git.kernel.org/cgit/network/connman/connman.git/commit/?id=3bda07204b11158dd18322db6e64dc92bdd07124"
Change-Id: I1731bfd21324c83a87f4ff2a5fccf264fd7883f5
Signed-off-by: Maneesh Jain <maneesh.jain@samsung.com>
Diffstat (limited to 'plugins')
-rwxr-xr-x | plugins/wifi.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/plugins/wifi.c b/plugins/wifi.c index 76a1d7a0..1c136f32 100755 --- a/plugins/wifi.c +++ b/plugins/wifi.c @@ -133,6 +133,8 @@ struct wifi_data { struct connman_network *scan_pending_network; bool allow_full_scan; #endif + int disconnect_code; + }; #if defined TIZEN_EXT @@ -2658,6 +2660,25 @@ static void interface_state(GSupplicantInterface *interface) network, wifi)) break; +#if defined TIZEN_EXT + wifi->disconnect_code = g_supplicant_interface_get_disconnect_reason(wifi->interface); + DBG("Disconnect Reason code %d", wifi->disconnect_code); +#endif + /* See table 8-36 Reason codes in IEEE Std 802.11 */ + switch (wifi->disconnect_code) { + case 1: /* Unspecified reason */ + /* Let's assume it's because we got blocked */ + + case 6: /* Class 2 frame received from nonauthenticated STA */ + connman_network_set_error(network, + CONNMAN_NETWORK_ERROR_BLOCKED); + break; + + default: + break; + } + + /* We disable the selected network, if not then * wpa_supplicant will loop retrying */ if (g_supplicant_interface_enable_selected_network(interface, @@ -2666,13 +2687,11 @@ static void interface_state(GSupplicantInterface *interface) #if defined TIZEN_EXT int err; - int reason_code = 0; err = g_supplicant_interface_remove_network(wifi->interface); if (err < 0) DBG("Failed to remove network(%d)", err); - reason_code = g_supplicant_interface_get_disconnect_reason(wifi->interface); /* Some of Wi-Fi networks are not comply Wi-Fi specification. * Retry association until its retry count is expired */ @@ -2682,9 +2701,9 @@ static void interface_state(GSupplicantInterface *interface) break; } - if(reason_code > 0){ - DBG("Set disconnect reason code(%d)", reason_code); - connman_network_set_disconnect_reason(network, reason_code); + if(wifi->disconnect_code > 0){ + DBG("Set disconnect reason code(%d)", wifi->disconnect_code); + connman_network_set_disconnect_reason(network, wifi->disconnect_code); } /* To avoid unnecessary repeated association in wpa_supplicant, |