[PATCH 4/4] P2P: Fix association with an AP that is not a P2P manager

Peer, Ilan ilan.peer
Sun May 3 22:34:47 PDT 2015

Hi Jouni,

> -----Original Message-----
> From: hostap-bounces at lists.shmoo.com [mailto:hostap-
> bounces at lists.shmoo.com] On Behalf Of Jouni Malinen
> Sent: Sunday, May 03, 2015 17:52
> To: hostap at lists.shmoo.com
> Subject: Re: [PATCH 4/4] P2P: Fix association with an AP that is not a P2P
> manager
> On Tue, Apr 28, 2015 at 02:01:05PM +0300, Ilan Peer wrote:
> > Do not add P2P IE when a non P2P interface is associating to an AP the
> > is not a P2P manager, i.e., does set the managed bit in the P2P
> > capability attribute.
> Why? This description about managed bit is not accurate. That bit is not even
> sent out by the WLAN AP and even if it were, it does not indicate that the
> device sending it is a P2P manager; it indicates whether the P2P Device is
> capable of being managed.

This patch tried to solve the following bug report: https://bugzilla.kernel.org/show_bug.cgi?id=96471

In short, when an Intel device tried to associate a Soft AP started on a blackberry phone, which was actually a P2P GO, the association was denied with no specific reason. When constructing the association request, since the ssid->p2p_group was no set, the flow eventually called p2p_assoc_req_ie_wlan_ap() to add P2P capability attribute. With the information collected in the bug it seemed that the P2P GO rejected the association since it 'invalid' P2P IE was provided.

> > diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c @@ -2485,10 +2485,21 @@
> > static int p2p_assoc_req_ie_wlan_ap(struct p2p_data *p2p, const u8
> > *bssid,
> > +	peer = p2p_get_device(p2p, bssid);
> > +	if (!peer)
> > +		return 0;
> This breaks managed P2P behavior. A WLAN AP (not a P2P Device/GO) is not
> supposed to have a peer entry.

As explained above, this was not the case of a WLAN AP ... I should have better explained this in the commit message.

> > +	p2p_dbg(p2p, "P2P: managed assoc to " MACSTR" capa=0x%X",
> > +		MAC2STR(bssid), peer->info.dev_capab);
> > +
> > +	if (!(peer->info.dev_capab & P2P_DEV_CAPAB_INFRA_MANAGED))
> > +		return 0;
> This makes no sense either since the WLAN AP would not even include P2P
> Capability in the Beacon/Probe Response frames. It only includes the P2P
> Manageability attribute.

So a better fix for this issue would to parse the p2p_ie and check if the P2P manageability attribute is included before adding the P2P IE?



More information about the Hostap mailing list