]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Make p2p_flush stop P2P operations consistently
authorJouni Malinen <jouni@qca.qualcomm.com>
Mon, 27 Feb 2012 17:10:04 +0000 (19:10 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 27 Feb 2012 17:10:04 +0000 (19:10 +0200)
p2p_flush did not explicit stop all P2P operations, i.e., the exact
behavior depended on the P2P module state at the time the p2p_flush
command was issued. Make this more consistent by explicitly calling
p2p_stop_find() from p2p_flush().

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

src/p2p/p2p.c

index b196e6fddd680e63716e982394f68d942153a72c..6a48dba6b25d1e536c94b4b4030dbed905a54aa2 100644 (file)
@@ -2245,11 +2245,7 @@ void p2p_deinit(struct p2p_data *p2p)
 void p2p_flush(struct p2p_data *p2p)
 {
        struct p2p_device *dev, *prev;
-       p2p_clear_timeout(p2p);
-       p2p_set_state(p2p, P2P_IDLE);
-       p2p->start_after_scan = P2P_AFTER_SCAN_NOTHING;
-       p2p->go_neg_peer = NULL;
-       eloop_cancel_timeout(p2p_find_timeout, p2p, NULL);
+       p2p_stop_find(p2p);
        dl_list_for_each_safe(dev, prev, &p2p->devices, struct p2p_device,
                              list) {
                dl_list_del(&dev->list);