network: Disconnect network properly
authorJukka Rissanen <jukka.rissanen@linux.intel.com>
Tue, 1 Nov 2011 09:09:55 +0000 (11:09 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 7 Nov 2011 11:40:12 +0000 (12:40 +0100)
When network is removed (for example when ethernet cable
is disconnected), then it needs to be disconnected also.
The disconnect was not done at all because of the reference
counting fixes in dhcp code.

src/network.c

index b58409f2e7d1f5a00cd0e3eacc401fdd6851d87e..58837860317500de23fe127f06da0abcc1c35136 100644 (file)
@@ -178,6 +178,8 @@ static void network_remove(struct connman_network *network)
        if (network->driver == NULL)
                return;
 
+       connman_network_set_connected(network, FALSE);
+
        switch (network->type) {
        case CONNMAN_NETWORK_TYPE_UNKNOWN:
        case CONNMAN_NETWORK_TYPE_VENDOR: