1
0
Fork 0
mirror of https://github.com/albfan/miraclecast.git synced 2025-02-14 20:12:00 +00:00

miracled: try at most 5 times to connect to wpas

If, after 5 times (which is 1s), wpa_supplicant is still not reachable, we
now drop the link. This avoids hangup issues during wpas startup that
might happen from time to time.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
This commit is contained in:
David Herrmann 2014-02-17 16:47:24 +01:00
parent 6a37cbe6b8
commit fe571fb729
2 changed files with 2 additions and 1 deletions

View file

@ -184,7 +184,7 @@ static int link_wifi_startup_fn(sd_event_source *source,
r = link_wifi_start(l);
if (r < 0) {
if (wifi_is_open(l->w)) {
if (wifi_is_open(l->w) || ++l->wpa_startup_attempts >= 5) {
log_error("cannot start wifi on link %s", l->name);
link_free(l);
return 0;

View file

@ -97,6 +97,7 @@ struct link {
struct wifi *w;
sd_event_source *wpa_child_source;
sd_event_source *wpa_startup_source;
unsigned int wpa_startup_attempts;
bool running : 1;
};