From: Ilan Peer Date: Mon, 4 May 2015 12:50:46 +0000 (+0300) Subject: P2P: Fix association with an AP/P2P GO that is not a P2P manager X-Git-Tag: hostap_2_5~738 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b05135aa477f2c64d08bdb99062907cf767c1ea;p=thirdparty%2Fhostap.git P2P: Fix association with an AP/P2P GO that is not a P2P manager Do not add a P2P IE when a station interface is trying to associate to an AP or P2P GO that publishes a P2P IE but does not include a P2P manageability attribute. This addresses an interoperability issue that was reported in https://bugzilla.kernel.org/show_bug.cgi?id=96471, where a P2P GO rejects association from a station interface without a specified reason. Signed-off-by: Ilan Peer --- diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index a45fe73b9..c02044b1a 100644 --- 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, size_t tmplen; int res; u8 group_capab; + struct p2p_message msg; if (p2p_ie == NULL) return 0; /* WLAN AP is not a P2P manager */ + os_memset(&msg, 0, sizeof(msg)); + if (p2p_parse_p2p_ie(p2p_ie, &msg) < 0) + return 0; + + p2p_dbg(p2p, "BSS P2P manageability %s", + msg.manageability ? "enabled" : "disabled"); + + if (!msg.manageability) + return 0; + /* * (Re)Association Request - P2P IE * P2P Capability attribute (shall be present)