]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Clear WPS method when GO negotiation fails
authorJohannes Berg <johannes.berg@intel.com>
Fri, 18 Nov 2011 21:34:53 +0000 (23:34 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 18 Nov 2011 21:34:53 +0000 (23:34 +0200)
When GO negotation fails the WPS method is currently not cleared, which
can result in GO negotiation being resumed when a GO negotiation request
frame is received from the peer. That is unexpected as locally we
already gave up.

This manifests itself in getting

1319574733.955685: wlan0: P2P-GO-NEG-FAILURE status=-1
1319574733.955723: P2P: Removing pending group interface p2p-wlan0-0
...
1319574736.648378: wlan0: P2P: Starting GO Negotiation with previously
authorized peer
...
1319574736.650115: wlan0: P2P: Sending GO Negotiation Response
...
1319574736.988038: wlan0: P2P-GO-NEG-SUCCESS
1319574736.988233: P2P: No pending group interface
1319574736.988268: P2P: Create a new interface p2p-wlan0-1 for the group

Clear the WPS method to avoid this situation. I wasn't
able to test this though, but given the log I can only
assume this is how the situation happened.

Reported-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-hostap: Johannes Berg <johannes.berg@intel.com>

src/p2p/p2p.c

index 8280c240006024123fc5d1bce927274f256761c0..c30750586ee6cf37449667174cd66b99bba7db63 100644 (file)
@@ -146,6 +146,8 @@ void p2p_go_neg_failed(struct p2p_data *p2p, struct p2p_device *peer,
        struct p2p_go_neg_results res;
        p2p_clear_timeout(p2p);
        p2p_set_state(p2p, P2P_IDLE);
+       if (p2p->go_neg_peer)
+               p2p->go_neg_peer->wps_method = WPS_NOT_READY;
        p2p->go_neg_peer = NULL;
 
        os_memset(&res, 0, sizeof(res));