diff options
| author | Pawit Pornkitprasan <p.pawit@gmail.com> | 2012-05-21 23:18:41 +0700 |
|---|---|---|
| committer | Pawit Pornkitprasan <p.pawit@gmail.com> | 2012-05-21 23:18:41 +0700 |
| commit | 35074788b43db7760e654be9b80275271d668c69 (patch) | |
| tree | 56e1db37861d1c530727323f15b586037216a7f4 | |
| parent | 6c70d496d0eae3ee18e496baf0e3e561c450d34c (diff) | |
| download | android_external_wpa_supplicant_8-35074788b43db7760e654be9b80275271d668c69.tar.gz android_external_wpa_supplicant_8-35074788b43db7760e654be9b80275271d668c69.tar.bz2 android_external_wpa_supplicant_8-35074788b43db7760e654be9b80275271d668c69.zip | |
wpa_supplicant_8: Do not try to create ad-hoc network
wpa_supplicant_8 will try to create a new ad-hoc network if no
available network is found. This will not work because the freq
is not set and it will keep retrying draining the battery (not
allowing the phone to go to sleep).
Change-Id: I2226a3d73bf4e6b5d72e463504644f07b351082e
| -rw-r--r-- | wpa_supplicant/events.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index dd55edf8..da9c9612 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -779,6 +779,12 @@ wpa_supplicant_pick_new_network(struct wpa_supplicant *wpa_s) int prio; struct wpa_ssid *ssid; +// Don't try to automatically start a new ad-hoc network if no network +// is available on Android. It doesn't make sense as it'll fail anyway +// because nothing will reply to the DHCP request. (It'll also +// repeatedly fail because the frequency is not set and it'll keep +// retrying draining battery.) +#ifndef ANDROID for (prio = 0; prio < wpa_s->conf->num_prio; prio++) { for (ssid = wpa_s->conf->pssid[prio]; ssid; ssid = ssid->pnext) { @@ -789,6 +795,7 @@ wpa_supplicant_pick_new_network(struct wpa_supplicant *wpa_s) return ssid; } } +#endif return NULL; } |
