service: Do not autoconnect if service is getting removed
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Mon, 16 Apr 2012 13:21:38 +0000 (16:21 +0300)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Tue, 17 Apr 2012 10:37:37 +0000 (13:37 +0300)
While unplugging ethernet cable,
__connman_service_remove_from_network() is called since
related network is getting cleaned up. Therefore ethernet
service goes from online/ready to disconnected, and end
to idle state. However, at that state auto_connect() is
called (even if this service is "planned" to disappear
due to network getting cleaned up) adn we end up with
ethernet network not disappearing, nor its related
service. We only need to set the service as "ignored", so
auto_connect will ignore that particular service.

src/service.c

index 5ce6f32..5805bfc 100644 (file)
@@ -5854,6 +5854,8 @@ void __connman_service_remove_from_network(struct connman_network *network)
        if (service == NULL)
                return;
 
+       service->ignore = TRUE;
+
        __connman_connection_gateway_remove(service,
                                        CONNMAN_IPCONFIG_TYPE_ALL);