summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Kim <jeik01.kim@samsung.com>2022-01-13 16:12:30 +0900
committerJaehyun Kim <jeik01.kim@samsung.com>2022-01-13 16:12:30 +0900
commit75fa47a8b0cd69f44b973d1217bab66c1f2426d3 (patch)
treea80d4e80e46cddcfd18f75f51c56d3cf26465a12
parent67014112bc78a2b6fa7857bf637ce646fa61cb75 (diff)
downloadconnman-75fa47a8b0cd69f44b973d1217bab66c1f2426d3.tar.gz
connman-75fa47a8b0cd69f44b973d1217bab66c1f2426d3.tar.bz2
connman-75fa47a8b0cd69f44b973d1217bab66c1f2426d3.zip
Add support for handling wifi authentication failuresubmit/tizen/20220118.052414accepted/tizen/unified/20220119.121745
Change-Id: I770e67fa3ed17758c745469cc51ecdc08d591708 Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
-rwxr-xr-xinclude/network.h1
-rwxr-xr-xinclude/service.h3
-rw-r--r--packaging/connman.spec2
-rwxr-xr-xplugins/wifi.c15
-rwxr-xr-xsrc/network.c24
-rwxr-xr-xsrc/service.c7
6 files changed, 47 insertions, 5 deletions
diff --git a/include/network.h b/include/network.h
index d1838a7d..9f5bb1fc 100755
--- a/include/network.h
+++ b/include/network.h
@@ -66,6 +66,7 @@ enum connman_network_error {
#if defined TIZEN_EXT
CONNMAN_NETWORK_ERROR_DHCP_FAIL = 5,
CONNMAN_NETWORK_ERROR_BLOCKED = 6,
+ CONNMAN_NETWORK_ERROR_AUTHENTICATE_FAIL = 7,
#else
CONNMAN_NETWORK_ERROR_BLOCKED = 5,
#endif
diff --git a/include/service.h b/include/service.h
index e41bba39..acd8852c 100755
--- a/include/service.h
+++ b/include/service.h
@@ -100,6 +100,9 @@ enum connman_service_error {
CONNMAN_SERVICE_ERROR_AUTH_FAILED = 6,
CONNMAN_SERVICE_ERROR_INVALID_KEY = 7,
CONNMAN_SERVICE_ERROR_BLOCKED = 8,
+#if defined TIZEN_EXT
+ CONNMAN_SERVICE_ERROR_ASSOC_FAILED = 9,
+#endif
};
enum connman_service_proxy_method {
diff --git a/packaging/connman.spec b/packaging/connman.spec
index a7300cc7..7273013a 100644
--- a/packaging/connman.spec
+++ b/packaging/connman.spec
@@ -6,7 +6,7 @@
Name: connman
Version: 1.38
-Release: 11
+Release: 12
License: GPL-2.0+
Summary: Connection Manager
Url: http://connman.net
diff --git a/plugins/wifi.c b/plugins/wifi.c
index 3b709d87..0b5315f0 100755
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -4482,7 +4482,8 @@ static bool handle_wifi_assoc_retry(struct connman_network *network,
return false;
}
- if (wifi->state != G_SUPPLICANT_STATE_ASSOCIATING &&
+ if (wifi->state != G_SUPPLICANT_STATE_AUTHENTICATING &&
+ wifi->state != G_SUPPLICANT_STATE_ASSOCIATING &&
wifi->state != G_SUPPLICANT_STATE_ASSOCIATED) {
wifi->assoc_retry_count = 0;
return false;
@@ -4502,7 +4503,17 @@ static bool handle_wifi_assoc_retry(struct connman_network *network,
* however QA team recommends that the invalid-key error
* might be better to display for user experience.
*/
- connman_network_set_error(network, CONNMAN_NETWORK_ERROR_ASSOCIATE_FAIL);
+ switch (wifi->state) {
+ case G_SUPPLICANT_STATE_AUTHENTICATING:
+ connman_network_set_error(network, CONNMAN_NETWORK_ERROR_AUTHENTICATE_FAIL);
+ break;
+ case G_SUPPLICANT_STATE_ASSOCIATED:
+ connman_network_set_error(network, CONNMAN_NETWORK_ERROR_INVALID_KEY);
+ break;
+ default:
+ connman_network_set_error(network, CONNMAN_NETWORK_ERROR_ASSOCIATE_FAIL);
+ break;
+ }
return false;
}
diff --git a/src/network.c b/src/network.c
index ded10402..d71b419f 100755
--- a/src/network.c
+++ b/src/network.c
@@ -1793,6 +1793,22 @@ int connman_network_set_associating(struct connman_network *network,
return 0;
}
+#if defined TIZEN_EXT
+static void set_authenticate_error(struct connman_network *network)
+{
+ struct connman_service *service;
+
+ service = connman_service_lookup_from_network(network);
+
+ if (!service)
+ return;
+
+ __connman_service_indicate_error(service,
+ CONNMAN_SERVICE_ERROR_AUTH_FAILED);
+}
+#endif
+
+
static void set_associate_error(struct connman_network *network)
{
struct connman_service *service;
@@ -1800,8 +1816,11 @@ static void set_associate_error(struct connman_network *network)
service = connman_service_lookup_from_network(network);
#if defined TIZEN_EXT
+ if (!service)
+ return;
+
__connman_service_indicate_error(service,
- CONNMAN_SERVICE_ERROR_AUTH_FAILED);
+ CONNMAN_SERVICE_ERROR_ASSOC_FAILED);
#else
__connman_service_indicate_error(service,
CONNMAN_SERVICE_ERROR_CONNECT_FAILED);
@@ -1923,6 +1942,9 @@ void connman_network_set_error(struct connman_network *network,
set_connect_error(network);
break;
#if defined TIZEN_EXT
+ case CONNMAN_NETWORK_ERROR_AUTHENTICATE_FAIL:
+ set_authenticate_error(network);
+ break;
case CONNMAN_NETWORK_ERROR_DHCP_FAIL:
set_dhcp_error(network);
break;
diff --git a/src/service.c b/src/service.c
index d2f89d2a..5e7eb8d0 100755
--- a/src/service.c
+++ b/src/service.c
@@ -516,6 +516,10 @@ static const char *error2string(enum connman_service_error error)
return "login-failed";
case CONNMAN_SERVICE_ERROR_AUTH_FAILED:
return "auth-failed";
+#ifdef TIZEN_EXT
+ case CONNMAN_SERVICE_ERROR_ASSOC_FAILED:
+ return "assoc-failed";
+#endif
case CONNMAN_SERVICE_ERROR_INVALID_KEY:
return "invalid-key";
case CONNMAN_SERVICE_ERROR_BLOCKED:
@@ -8606,7 +8610,8 @@ static void report_error_cb(void *user_context, bool retry,
service->state_ipv4 = service->state_ipv6 =
CONNMAN_SERVICE_STATE_IDLE;
- if (service->error != CONNMAN_SERVICE_ERROR_AUTH_FAILED)
+ if (service->error != CONNMAN_SERVICE_ERROR_AUTH_FAILED &&
+ service->error != CONNMAN_SERVICE_ERROR_ASSOC_FAILED)
set_error(service, CONNMAN_SERVICE_ERROR_UNKNOWN);
#endif
service_complete(service);