[PATCH] P2P: Add missing stop_listen call in p2p_state_timeout

Musca, Constantin constantin.musca at intel.com
Fri Oct 10 03:27:54 EDT 2014


And, yes, 17e20912790a2cca616ddd2856e60e871a377726 ('P2P: Fix radio work issue with wait-for-peer GO Negotiation') doesn't fix this issue.

\Constantin

-----Original Message-----
From: Musca, Constantin 
Sent: Friday, October 10, 2014 10:20 AM
To: Jouni Malinen; hostap at lists.shmoo.com
Subject: RE: [PATCH] P2P: Add missing stop_listen call in p2p_state_timeout

Please look at the following sequence:

2736:10-10 02:57:02.480 D/wpa_supplicant( 2570): P2P: * Device Info: addr be:f5:ac:ff:d5:ea primary device type 10-0050F204-5 device name 'Android_6de7' config methods 0x188
2737:10-10 02:57:02.480 D/wpa_supplicant( 2570): P2P: GO Negotiation rejected: status 1
2738:10-10 02:57:02.480 D/wpa_supplicant( 2570): P2P: Wait for the peer to become ready for GO Negotiation
2739:10-10 02:57:02.480 D/wpa_supplicant( 2570): P2P: State CONNECT -> WAIT_PEER_IDLE
2740:10-10 02:57:02.480 D/wpa_supplicant( 2570): P2P: Set timeout (state=WAIT_PEER_IDLE): 0.000000 sec
2741:10-10 02:57:02.480 D/wpa_supplicant( 2570): p2p0: Radio work 'p2p-send-action'@0xf6e18400 done in 0.055031 seconds
2742:10-10 02:57:02.480 D/wpa_supplicant( 2570): Off-channel: Action frame sequence done notification
2743:10-10 02:57:02.480 D/wpa_supplicant( 2570): nl80211: Cancel TX frame wait: cookie=0xffff880033af1038
2744:10-10 02:57:02.480 D/wpa_supplicant( 2570): nl80211: wait cancel failed: ret=-95 (Operation not supported on transport endpoint)
2745:10-10 02:57:02.480 D/wpa_supplicant( 2570): P2P: Timeout (state=WAIT_PEER_IDLE)
2746:10-10 02:57:02.480 D/wpa_supplicant( 2570): P2P: Go to Listen state while waiting for the peer to become ready for GO Negotiation
2747:10-10 02:57:02.480 D/wpa_supplicant( 2570): P2P: State WAIT_PEER_IDLE -> WAIT_PEER_CONNECT
2748:10-10 02:57:02.480 D/wpa_supplicant( 2570): P2P: Starting short listen state (state=WAIT_PEER_CONNECT)
2749:10-10 02:57:02.485 D/wpa_supplicant( 2570): WPS:  * Version (hardcoded 0x10)
2750:10-10 02:57:02.485 D/wpa_supplicant( 2570): P2P: WPS IE Device Password ID: 4
2751:10-10 02:57:02.485 D/wpa_supplicant( 2570): WPS:  * UUID-E
2752:10-10 02:57:02.485 D/wpa_supplicant( 2570): WPS:  * Version2 (0x20)
2753:10-10 02:57:02.485 D/wpa_supplicant( 2570): P2P: * P2P IE header
2754:10-10 02:57:02.485 D/wpa_supplicant( 2570): P2P: * Capability dev=21 group=00
2755:10-10 02:57:02.485 D/wpa_supplicant( 2570): P2P: * Device Info
2756:10-10 02:57:02.485 D/wpa_supplicant( 2570): p2p0: Add radio work 'p2p-listen'@0xf6e18400
2757:10-10 02:57:02.485 D/wpa_supplicant( 2570): p2p0: First radio work item in the queue - schedule start immediately
2758:10-10 02:57:02.485 D/wpa_supplicant( 2570): p2p0: Starting radio work 'p2p-listen'@0xf6e18400 after 0.000106 second wait
2759:10-10 02:57:02.486 D/wpa_supplicant( 2570): wpa_driver_set_ap_wps_p2p_ie: Entry
2760:10-10 02:57:02.486 D/wpa_supplicant( 2570): wpa_driver_nl80211_driver_cmd 82 buf = SET_AP_WPS_P2P_IE 2, len = 19
2761:10-10 02:57:02.486 D/wpa_supplicant( 2570): wpa_driver_nl80211_driver_cmd  len = 0, 0
2762:10-10 02:57:02.486 D/wpa_supplicant( 2570): nl80211: Enable Probe Request reporting nl_preq=0xf6e18580
2763:10-10 02:57:02.486 D/wpa_supplicant( 2570): nl80211: Register frame type=0x40 (WLAN_FC_STYPE_PROBE_REQ) nl_handle=0xf6e18580 match=
2764:10-10 02:57:02.494 D/wpa_supplicant( 2570): nl80211: Remain-on-channel cookie 0xffffffffa010a180 for freq=2462 MHz duration=307
2765:10-10 02:57:02.495 D/wpa_supplicant( 2570): nl80211: Event message available
2766:10-10 02:57:02.495 D/wpa_supplicant( 2570): nl80211: Drv Event 55 (NL80211_CMD_REMAIN_ON_CHANNEL) received for p2p0
2767:10-10 02:57:02.495 D/wpa_supplicant( 2570): nl80211: Remain-on-channel event (cancel=0 freq=2462 channel_type=0 duration=921 cookie=0xffffffffa010a180 (match))
2768:10-10 02:57:02.495 D/wpa_supplicant( 2570): p2p0: Event REMAIN_ON_CHANNEL (21) received
2769:10-10 02:57:02.495 D/wpa_supplicant( 2570): Off-channel: Send Action callback (without_roc=0 pending_action_tx=0x0 pending_action_tx_done=1)
2770:10-10 02:57:02.495 D/wpa_supplicant( 2570): P2P: Starting Listen timeout(0,307200) on freq=2462 based on callback
2771:10-10 02:57:02.495 D/wpa_supplicant( 2570): P2P: Set timeout (state=WAIT_PEER_CONNECT): 0.327200 sec
2788:10-10 02:57:02.824 D/wpa_supplicant( 2570): P2P: Timeout (state=WAIT_PEER_CONNECT)
2789:10-10 02:57:02.824 D/wpa_supplicant( 2570): P2P: State WAIT_PEER_CONNECT -> WAIT_PEER_IDLE
2790:10-10 02:57:02.824 D/wpa_supplicant( 2570): P2P: Set timeout (state=WAIT_PEER_IDLE): 0.200000 sec
2791:10-10 02:57:03.025 D/wpa_supplicant( 2570): P2P: Timeout (state=WAIT_PEER_IDLE)
2792:10-10 02:57:03.025 D/wpa_supplicant( 2570): P2P: Go to Listen state while waiting for the peer to become ready for GO Negotiation
2793:10-10 02:57:03.025 D/wpa_supplicant( 2570): P2P: State WAIT_PEER_IDLE -> WAIT_PEER_CONNECT
2794:10-10 02:57:03.025 D/wpa_supplicant( 2570): P2P: Starting short listen state (state=WAIT_PEER_CONNECT)
2795:10-10 02:57:03.030 D/wpa_supplicant( 2570): WPS:  * Version (hardcoded 0x10)
2796:10-10 02:57:03.030 D/wpa_supplicant( 2570): P2P: WPS IE Device Password ID: 4
2797:10-10 02:57:03.030 D/wpa_supplicant( 2570): WPS:  * UUID-E
2798:10-10 02:57:03.030 D/wpa_supplicant( 2570): WPS:  * Version2 (0x20)
2799:10-10 02:57:03.030 D/wpa_supplicant( 2570): P2P: * P2P IE header
2800:10-10 02:57:03.030 D/wpa_supplicant( 2570): P2P: * Capability dev=21 group=00
2801:10-10 02:57:03.030 D/wpa_supplicant( 2570): P2P: * Device Info
2802:10-10 02:57:03.030 D/wpa_supplicant( 2570): P2P: Reject start_listen since p2p_listen_work already exists
2803:10-10 02:57:03.030 D/wpa_supplicant( 2570): P2P: Failed to start listen mode


Regards,
Constantin

________________________________________
From: hostap-bounces at lists.shmoo.com [hostap-bounces at lists.shmoo.com] on behalf of Jouni Malinen [j at w1.fi]
Sent: Sunday, September 28, 2014 7:44 PM
To: hostap at lists.shmoo.com
Subject: Re: [PATCH] P2P: Add missing stop_listen call in p2p_state_timeout

On Fri, Sep 12, 2014 at 10:22:19AM +0300, Constantin Musca wrote:
> When a P2P timeout occurs and p2p_state_timeout is executed, the 
> stop_listen function should also be called besides setting in_listen 
> to zero to avoid the incorrect cancellation of the new start_listen 
> request ("P2P: Reject start_listen since p2p_listen_work already exists").

Could you please clarify in what kind of sequence you were seeing start_listen getting rejected? The earlier commit
17e20912790a2cca616ddd2856e60e871a377726 ('P2P: Fix radio work issue with wait-for-peer GO Negotiation') was also addressing a case that hit this case and I would like to understand whether you are addressing the same issue or something else.

> diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c @@ -3451,6 +3451,7 @@ 
> static void p2p_state_timeout(void *eloop_ctx, void *timeout_ctx)
>       p2p_dbg(p2p, "Timeout (state=%s)", p2p_state_txt(p2p->state));
>
>       p2p->in_listen = 0;
> +     p2p->cfg->stop_listen(p2p->cfg->cb_ctx);

I'm not completely sure about this change since it is quite different approach compared to how stop_listen is used currently. As such, I'd like to understand better the case(s) you are trying to address with this change.

--
Jouni Malinen                                            PGP id EFC895FA
_______________________________________________
HostAP mailing list
HostAP at lists.shmoo.com
http://lists.shmoo.com/mailman/listinfo/hostap


More information about the HostAP mailing list