Cumulative patch from commit 9b05135aa477f2c64d08bdb99062907cf767c1ea

9b05135 P2P: Fix association with an AP/P2P GO that is not a P2P manager
8884ce0 hostapd: check validity of cwMin/cwMax values
9649b53 vlan: Print libnl error message on vlan_add / vlan_del
279724d Add QCA vendor subcmd for Link Property Query

Change-Id: I33606ae68e16c8eb07473add034c7bca5aa6e153
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index a45fe73..c02044b 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
@@ -2485,10 +2485,21 @@
 	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)