Skip to content

Commit

Permalink
[connman] add online check retry for ipv4 as well.
Browse files Browse the repository at this point in the history
we might also increase the timer here or number of checks needed.
  • Loading branch information
Lorn Potter committed Nov 18, 2013
1 parent 04f8c7d commit 82b6030
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions connman/src/service.c
Expand Up @@ -5813,15 +5813,24 @@ static gboolean redo_wispr(gpointer user_data)
return FALSE;
}

static gboolean redo_wispr_ipv4(gpointer user_data)
{
struct connman_service *service = user_data;

DBG("");

__connman_wispr_start(service, CONNMAN_IPCONFIG_TYPE_IPV4);

return FALSE;
}

int __connman_service_online_check_failed(struct connman_service *service,
enum connman_ipconfig_type type)
{
DBG("service %p type %d count %d", service, type,
service->online_check_count);

/* currently we only retry IPv6 stuff */
if (type == CONNMAN_IPCONFIG_TYPE_IPV4 ||
service->online_check_count != 1) {
if (service->online_check_count != 1) {
connman_warn("Online check failed for %p %s", service,
service->name);
return 0;
Expand All @@ -5834,7 +5843,11 @@ int __connman_service_online_check_failed(struct connman_service *service,
* necessary IPv6 router advertisement messages that might have
* DNS data etc.
*/
if (type == CONNMAN_IPCONFIG_TYPE_IPV4) {
g_timeout_add_seconds(1, redo_wispr_ipv4, service);
} else {
g_timeout_add_seconds(1, redo_wispr, service);
}

return EAGAIN;
}
Expand Down Expand Up @@ -5885,6 +5898,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;
check_proxy_setup(service);
service_rp_filter(service, TRUE);
} else {
Expand Down

0 comments on commit 82b6030

Please sign in to comment.