diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2009-07-16 06:31:08 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2009-07-16 06:31:08 +0200 |
commit | 6d8c275119c3294c92cd5d3b1d63feb341bec20f (patch) | |
tree | 2a692423cd85c3fdd1170f7086a595596d22ed63 | |
parent | e8ecd3ecf5d3cee856d4a054a5f2887c8411485e (diff) | |
download | connman-6d8c275119c3294c92cd5d3b1d63feb341bec20f.tar.gz connman-6d8c275119c3294c92cd5d3b1d63feb341bec20f.tar.bz2 connman-6d8c275119c3294c92cd5d3b1d63feb341bec20f.zip |
Fix detection of association errors from supplicant
-rw-r--r-- | src/network.c | 8 | ||||
-rw-r--r-- | src/service.c | 4 |
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; |