service: Remove the gateways when removing the service
authorJukka Rissanen <jukka.rissanen@linux.intel.com>
Tue, 18 Oct 2011 10:17:46 +0000 (13:17 +0300)
committerSamuel Ortiz <sameo@linux.intel.com>
Fri, 28 Oct 2011 15:56:19 +0000 (17:56 +0200)
This is needed because connection.c takes a reference
of the service so we want to remove the gateways properly
so that service can be deleted and IP addresses released
when disconnection comes from network side (like when
ethernet cable is disconnected).

src/service.c

index 45ea4ba..355b162 100644 (file)
@@ -5587,6 +5587,9 @@ void __connman_service_remove_from_network(struct connman_network *network)
        if (service == NULL)
                return;
 
+       __connman_connection_gateway_remove(service,
+                                       CONNMAN_IPCONFIG_TYPE_ALL);
+
        __connman_service_put(service);
 }