network: Do not report any error when removing a connecting network
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Wed, 16 Jan 2013 10:57:14 +0000 (12:57 +0200)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Wed, 16 Jan 2013 14:53:14 +0000 (16:53 +0200)
When connecting a network, if it's related technology is disabled, this network
will raise an error through the agent. Leading to a possible retry request from
the user, then to a crash if the user does so.
Thus, we prevent any error to be raised in such situation and silently disconnect
the connecting network instead.

src/network.c

index ac4608b..bef6e0d 100644 (file)
@@ -805,7 +805,8 @@ static void network_remove(struct connman_network *network)
        if (network->driver == NULL)
                return;
 
-       connman_network_set_connected(network, FALSE);
+       if (network->connected == TRUE)
+               set_disconnected(network);
 
        switch (network->type) {
        case CONNMAN_NETWORK_TYPE_UNKNOWN: