[PATCH 2/2] P2P: Add support for freq option in p2p_find

Jouni Malinen j
Sat Nov 15 01:36:45 PST 2014


On Wed, Nov 05, 2014 at 08:35:09PM +0900, Daichi Ueura wrote:
> This allows a channel to be specified for the p2p_find.

What is the use case and expected behavior for this? The current design
would run only the first scan iteration on the specified channel
followed by continuous scans of the P2P social channels. Was that
expected? Or was this supposed to continue scanning the single specified
frequency multiple times?

> diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
> @@ -4091,8 +4092,16 @@ static int p2p_ctrl_find(struct wpa_supplicant *wpa_s, char *cmd)
>  	} else
>  		search_delay = wpas_p2p_search_delay(wpa_s);
>  
> +	pos = os_strstr(cmd, "freq=");
> +	if (pos) {
> +		pos += 6;
> +		freq = atoi(pos);

That is off-by-one, i.e., the first digit of the freq value is dropped
which will make the scan fail due to an invalid frequency parameter.

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list