Skip to content

Commit

Permalink
[modesetting] Retry network setting before starting post services. Co…
Browse files Browse the repository at this point in the history
…ntributes: JB#30264

When we retry the network setting when setting the mode, we need to do this
before running post services so dhcp starts correctly.

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
  • Loading branch information
philippedeswert committed Jul 6, 2015
1 parent ca67fee commit 244191d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/usb_moded-modesetting.c
Expand Up @@ -382,6 +382,15 @@ int set_dynamic_mode(void)
#endif /* DEBIAN */
}

/* try a second time to bring up the network if it failed the first time,
this can happen with functionfs based gadgets (which is why we sleep for a bit */
if(network != 0)
{
log_debug("Retry setting up te network\n");
sleep(1);
usb_network_up(data);
}

/* Needs to be called before application post synching so
that the dhcp server has the right config */
if(data->nat || data->dhcp_server)
Expand All @@ -396,15 +405,6 @@ int set_dynamic_mode(void)
connman_set_tethering(data->connman_tethering, TRUE);
#endif

/* try a second time to bring up the network if it failed the first time,
this can happen with functionfs based gadgets (which is why we sleep for a bit */
if(network != 0)
{
log_debug("Retry setting up te network\n");
sleep(1);
usb_network_up(data);
}

if(ret)
usb_moded_send_error_signal(MODE_SETTING_FAILED);
return(ret);
Expand Down

0 comments on commit 244191d

Please sign in to comment.