Hi
Unable to connect with the WEP mode AP again with correct passphrase
if connecting the AP with wrong passphrase before.
Because the WEP has not 4way-handshake, ConnMan can't receive
the error message of the invalid key, and can't set
the passphrase to NULL when connection failed with wrong passphrase.
Commit message is wrong.
WEP is specified so you cannot tell the key was wrong.
And wpa_supplicant does not provide any "error message". You are just
assuming key was wrong,
but it could be due to something totally different (weak signal, buggy
AP, etc...)
---
plugins/wifi.c | 16 ++++++++++++++++
src/service.c | 4 +++-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/plugins/wifi.c b/plugins/wifi.c
index 533d6df..58bcff2 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -1416,6 +1416,7 @@ static void disconnect_callback(int result,
GSupplicantInterface *interface,
static int network_disconnect(struct connman_network *network)
{
struct connman_device *device = connman_network_get_device(network);
+ struct connman_service *service;
struct wifi_data *wifi;
int err;
@@ -1425,6 +1426,21 @@ static int network_disconnect(struct connman_network *network)
if (!wifi || !wifi->interface)
return -ENODEV;
+ if (connman_network_get_associating(network) == TRUE)
+ connman_network_set_error(network,
+ CONNMAN_NETWORK_ERROR_ASSOCIATE_FAIL);
+ else {
+ service = connman_service_lookup_from_network(network);
+
+ if (service != NULL &&
+ (__connman_service_is_connected_state(service,
+ CONNMAN_IPCONFIG_TYPE_IPV4) == FALSE &&
+ __connman_service_is_connected_state(service,
+ CONNMAN_IPCONFIG_TYPE_IPV6) == FALSE) &&
+ (connman_service_get_favorite(service) == FALSE))
+ __connman_service_set_passphrase(service, NULL);
+ }
+
network_disconnect is called in case the user disconnects explicitly.
You can't tell the association went bad here, you just don't know about
it. You cannot override wpa_supplicant interface's state.
And it's not up to the wifi plugin so decide what to do with the
passphrase. service owns this role.
connman_network_set_associating(network, false);
if (wifi->disconnecting)
diff --git a/src/service.c b/src/service.c
index 33cce14..6583dbf 100644
--- a/src/service.c
+++ b/src/service.c
@@ -5424,7 +5424,9 @@ int __connman_service_indicate_error(struct
connman_service *service,
set_error(service, error);
- if (service->error == CONNMAN_SERVICE_ERROR_INVALID_KEY)
+ if (service->error == CONNMAN_SERVICE_ERROR_INVALID_KEY ||
+ (service->favorite == FALSE &&
+ service->error == CONNMAN_SERVICE_ERROR_CONNECT_FAILED))
__connman_service_set_passphrase(service, NULL);
/*
_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman