diff --git a/src/wifi/wifid-supplicant.c b/src/wifi/wifid-supplicant.c index bb18cef..7fe3da6 100644 --- a/src/wifi/wifid-supplicant.c +++ b/src/wifi/wifid-supplicant.c @@ -644,6 +644,9 @@ static void supplicant_peer_free(struct supplicant_peer *sp) 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); @@ -706,6 +709,9 @@ int supplicant_peer_connect(struct supplicant_peer *sp, if (sp->g) return 0; + if (sp->s->pending && sp->s->pending != sp) + return log_ERR(-EALREADY); + if (!prov_type && !(prov_type = sp->prov)) prov_type = "pbc"; if (!pin) @@ -1903,6 +1909,8 @@ int supplicant_p2p_start_scan(struct supplicant *s) if (!s->running || !s->has_p2p) return log_EINVAL(); + s->pending = NULL; + /* * This call is asynchronous. You can safely issue multiple of these * in parallel. You're supposed to track the "p2p_scanning" boolean