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

Daichi Ueura daichi.ueura
Fri Dec 5 21:34:58 PST 2014


Hi Jouni,

> That is off-by-one
I am sorry to send the patch that contains the issue.

> What is the use case and expected behavior for this?
The purpose is to reduce a time of scan phase when a client of
wpa_supplicant already knows operating channel* of peer(AutoGO), i.e.
we would like to scan a specified operating channel at first. So that
p2p connection time can be reduced. (e.g. several seconds can be
saved.)
*) Especially except for 1/6/11

> The current design would run only the first scan iteration on the specified channel followed by continuous scans of the P2P social channels.
Yes, this is what we expect. We would like to do single channel scan
(not full scan) at first.

Thank you,
Daichi

On Sat, Nov 15, 2014 at 6:36 PM, Jouni Malinen <j at w1.fi> wrote:
> 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