Correctly check whether a service has a network or a VPN provider
associated with it if the service fails already in
__connman_service_connect().
CONNMAN_SERVICE_STATE_FAILURE,
CONNMAN_IPCONFIG_TYPE_IPV6);
- __connman_network_disconnect(service->network);
+ if (service->network != NULL)
+ __connman_network_disconnect(service->network);
+ else if (service->type == CONNMAN_SERVICE_TYPE_VPN &&
+ service->provider != NULL)
+ __connman_provider_disconnect(service->provider);
if (service->userconnect == TRUE) {
if (err == -ENOKEY) {