summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-07-16 06:31:08 +0200
committerMarcel Holtmann <marcel@holtmann.org>2009-07-16 06:31:08 +0200
commit6d8c275119c3294c92cd5d3b1d63feb341bec20f (patch)
tree2a692423cd85c3fdd1170f7086a595596d22ed63
parente8ecd3ecf5d3cee856d4a054a5f2887c8411485e (diff)
downloadconnman-6d8c275119c3294c92cd5d3b1d63feb341bec20f.tar.gz
connman-6d8c275119c3294c92cd5d3b1d63feb341bec20f.tar.bz2
connman-6d8c275119c3294c92cd5d3b1d63feb341bec20f.zip
Fix detection of association errors from supplicant
-rw-r--r--src/network.c8
-rw-r--r--src/service.c4
2 files changed, 9 insertions, 3 deletions
diff --git a/src/network.c b/src/network.c
index 58dfea5a..42148a76 100644
--- a/src/network.c
+++ b/src/network.c
@@ -782,10 +782,11 @@ int connman_network_set_connected(struct connman_network *network,
DBG("network %p connected %d", network, connected);
- if (connected == FALSE && network->connecting == TRUE) {
+ if ((network->connecting || network->associating == TRUE) &&
+ connected == FALSE) {
connman_element_set_error(&network->element,
CONNMAN_ELEMENT_ERROR_CONNECT_FAILED);
- network->connecting = FALSE;
+ __connman_network_disconnect(network);
}
if (network->connected == connected)
@@ -890,7 +891,8 @@ int __connman_network_disconnect(struct connman_network *network)
DBG("network %p", network);
- if (network->connected == FALSE && network->connecting == FALSE)
+ if (network->connected == FALSE && network->connecting == FALSE &&
+ network->associating == FALSE)
return -ENOTCONN;
if (network->driver == NULL)
diff --git a/src/service.c b/src/service.c
index b6e049f4..38f553b8 100644
--- a/src/service.c
+++ b/src/service.c
@@ -973,6 +973,10 @@ int __connman_service_indicate_state(struct connman_service *service,
if (service->state == state)
return -EALREADY;
+ if (service->state == CONNMAN_SERVICE_STATE_FAILURE &&
+ state == CONNMAN_SERVICE_STATE_IDLE)
+ return -EINVAL;
+
if (service->state == CONNMAN_SERVICE_STATE_IDLE &&
state == CONNMAN_SERVICE_STATE_DISCONNECT)
return -EINVAL;