Skip to content

Commit

Permalink
service: Do not change default service if new default is not connected
Browse files Browse the repository at this point in the history
It is possible that we have already decided to change the default
gateway in connection.c but the service is still in configuration
state. In this case just return -EINPROGRESS and do nothing.
The default service will be changed in service_indicate_state()
a bit later anyway.
  • Loading branch information
jukkar authored and pfl committed Sep 2, 2013
1 parent 1ffe8aa commit 2be7d77
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/service.c
Expand Up @@ -5326,7 +5326,16 @@ int __connman_service_clear_error(struct connman_service *service)

int __connman_service_indicate_default(struct connman_service *service)
{
DBG("service %p", service);
DBG("service %p state %s", service, state2string(service->state));

if (!is_connected(service)) {
/*
* If service is not yet fully connected, then we must not
* change the default yet. The default gw will be changed
* after the service state is in ready.
*/
return -EINPROGRESS;
}

default_changed();

Expand Down

0 comments on commit 2be7d77

Please sign in to comment.