[PATCH 3/3] P2P: Optimize scan frequencies list when re-joining a persistent group

Jouni Malinen j at w1.fi
Sun Mar 29 03:34:27 EDT 2015


On Sun, Mar 22, 2015 at 08:20:35PM +0000, Peer, Ilan wrote:
> 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 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.

"P2P_GROUP_ADD persistent=<id>" can indeed start a P2P Client. I was not
talking about that; I was talking about how wpas_p2p_select_go_freq() is
used. It does not get called if the local device is a P2P Client in the
persistent group that gets restarted with P2P_GROUP_ADD.

wpas_p2p_select_go_freq() figures out the best channel a new GO instance
should be started on. It does not really make any sense to call it in
P2P Client case where you need to figure out what is the operating
channel of a peer device.

-- 
Jouni Malinen                                            PGP id EFC895FA


More information about the HostAP mailing list