[PATCH] P2P: prevent p2pdev from roaming

Arend van Spriel arend at broadcom.com
Mon Dec 1 05:37:35 EST 2014


On 12/01/14 11:05, Michal Kazior wrote:
> On 1 December 2014 at 10:32, Arend van Spriel<arend at broadcom.com>  wrote:
>> On 12/01/14 09:36, Michal Kazior wrote:
>>>
>>> It was possible for a P2P_DEVICE to receive scan results and
>>> subsequently start roaming due to a matching network. This caused
>>> P2P find stop working (state machines seemed to be confused).
> [...]
>>> +static int wpa_supplicant_is_p2pdev(struct wpa_supplicant *wpa_s)
>>> +{
>>> +       return wpa_s->parent&&   wpa_s->parent->p2p_dev == wpa_s;
>>> +}
>>> +
>>> +
>>>    static int wpa_supplicant_need_to_roam(struct wpa_supplicant *wpa_s,
>>>                                         struct wpa_bss *selected,
>>>                                         struct wpa_ssid *ssid)
>>> @@ -1146,6 +1152,8 @@ static int wpa_supplicant_need_to_roam(struct
>>> wpa_supplicant *wpa_s,
>>>          struct wpa_bss *current_bss = NULL;
>>>          int min_diff;
>>>
>>> +       if (wpa_supplicant_is_p2pdev(wpa_s))
>>
>>
>> Could check wpa_s->p2p_mgmt here instead, which is set for dedicated p2p
>> management interface, ie. p2pdev.
>
> Good point. I was a bit confused about p2p_mgmt flow at first. It
> seems to work fine as well. Thanks! I'll send a v2.

I actually have a local patch that avoid networks to be configured for 
the p2pdev interface which would have the same result as yours and 
another patch that ignores p2p_disabled configuration for the p2pdev. I 
will submit them so there is something to choose ;-)

Regards,
Arend


More information about the HostAP mailing list