Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[connman] make the ipv4 online check try harder.
Increase the interval exponentially up tp 10 minutes.
  • Loading branch information
Lorn Potter committed Nov 22, 2013
1 parent 4f027be commit e124243
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions connman/src/service.c
Expand Up @@ -5829,22 +5829,25 @@ int __connman_service_online_check_failed(struct connman_service *service,
{
DBG("service %p type %d count %d", service, type,
service->online_check_count);
int timeout = 0;

if (service->online_check_count != 1) {
if (service->online_check_count < 1) {
connman_warn("Online check failed for %p %s", service,
service->name);
return 0;
}

service->online_check_count = 0;
--service->online_check_count;

/*
* We set the timeout to 1 sec so that we have a chance to get
* necessary IPv6 router advertisement messages that might have
* DNS data etc.
*/
timeout = 12 - service->online_check_count;

if (type == CONNMAN_IPCONFIG_TYPE_IPV4) {
g_timeout_add_seconds(1, redo_wispr_ipv4, service);
g_timeout_add_seconds(timeout * timeout, redo_wispr_ipv4, service);
} else {
g_timeout_add_seconds(1, redo_wispr, service);
}
Expand Down Expand Up @@ -5898,7 +5901,7 @@ int __connman_service_ipconfig_indicate_state(struct connman_service *service,
update_nameservers(service);

if (type == CONNMAN_IPCONFIG_TYPE_IPV4) {
service->online_check_count = 1;
service->online_check_count = 12;//this works out to be about 10 minutes total
check_proxy_setup(service);
service_rp_filter(service, TRUE);
} else {
Expand Down

0 comments on commit e124243

Please sign in to comment.