summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrey Gusakov <adnrey.gusakov@cogentembedded.com>2014-08-26 08:58:02 +0400
committerDavid Herrmann <dh.herrmann@gmail.com>2014-09-03 08:42:16 +0200
commit06d7dce2ecfb87c9b7ef7f2ff0e68b407edea276 (patch)
treef7dd4f4a32577090f4e7d8ef5763c13af2c5322a /src
parent204fa269e3f15a36fd718c1d2e10828a25fdde95 (diff)
wifi: report formation failture if pending peer is lost
Properly notify API users if we free peers that are pending. This way, they don't have to use timers to restart peer discovery on wpa_supplicant failures. Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com> Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/wifi/wifid-supplicant.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/wifi/wifid-supplicant.c b/src/wifi/wifid-supplicant.c
index 7fe3da6..27a91ec 100644
--- a/src/wifi/wifid-supplicant.c
+++ b/src/wifi/wifid-supplicant.c
@@ -641,12 +641,14 @@ static void supplicant_peer_free(struct supplicant_peer *sp)
if (!sp)
return;
+ if (sp->s->pending == sp) {
+ sp->s->pending = NULL;
+ peer_supplicant_formation_failure(sp->p, "lost");
+ }
+
supplicant_peer_drop_group(sp);
peer_supplicant_stopped(sp->p);
peer_free(sp->p);
- /* free pending */
- if (sp->s->pending == sp)
- sp->s->pending = NULL;
free(sp->sta_mac);
free(sp->remote_addr);