[PATCH 3/3] P2P: Optimize scan frequencies list when re-joining a persistent group
Peer, Ilan
ilan.peer
Sun Mar 22 13:20:35 PDT 2015
On ?', 2015-03-22 at 21:17 +0200, Jouni Malinen wrote:
> On Mon, Mar 16, 2015 at 01:20:03AM -0400, Ilan Peer wrote:
> > When starting a P2P client to re-join a persistent group
> > (P2P_GROUP_ADD persistent=<id>), it is possible that the P2P GO was
> > already found in previous scans. Try to get the P2P GO operating
> > frequency from the scan results list so wpa_supplicant will initially
> > scan only the P2P GO known operating frequency.
>
> > diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
> > @@ -5504,18 +5504,26 @@ int wpas_p2p_group_add_persistent(struct wpa_supplicant *wpa_s,
> > - } else {
> > - freq = neg_freq;
> > - if (freq < 0 ||
> > - (freq > 0 && !freq_included(channels, freq)))
> > - freq = 0;
> > - }
> > + } else if (ssid->mode == WPAS_MODE_INFRA) {
> > + freq = wpas_p2p_select_go_freq(wpa_s, neg_freq);
>
> That looks suspicious.. wpas_p2p_select_go_freq() is used only on the GO
> device, so this cannot really be correct.
Indeed. But it seems that android (display) is using this API to
re-start a client as well. I'll try to get a log that shows this.
>
> > + if (freq <= 0 ||
> > + (freq > 0 && !freq_included(channels, freq))) {
> > + struct os_reltime now;
> > + struct wpa_bss *bss =
> > + wpa_bss_get_p2p_dev_addr(wpa_s, ssid->bssid);
> > +
> > + os_get_reltime(&now);
> > + if (bss &&
> > + !os_reltime_expired(&now, &bss->last_update, 5))
> > + freq = bss->freq;
> > + else
> > + freq = 0;
> > + }
>
> And the freq > 0 && !freq_included(channels, freq) case should clear
> freq to 0 to match the current behavior.
>
It does in case that the time is BSS is not new enough (5 seconds, to
match the fast associate flow).
Regards,
Ilan.
More information about the Hostap
mailing list