P2P: Allow P2P IE without Device Info in (Re)Assoc Req
authorJouni Malinen <jouni.malinen@atheros.com>
Sun, 1 Aug 2010 23:47:38 +0000 (16:47 -0700)
committerJouni Malinen <j@w1.fi>
Thu, 9 Sep 2010 14:17:21 +0000 (07:17 -0700)
This can happen, e.g., when a P2P client connects to a P2P group
using the infrastructure WLAN interface instead of P2P group
interface. In that case, the P2P client may behave as if the GO
would be a P2P Manager WLAN AP.

src/ap/ieee802_11.c
src/p2p/p2p_group.c

index 99285bc..7e0b89b 100644 (file)
@@ -781,8 +781,12 @@ static u16 check_assoc_ies(struct hostapd_data *hapd, struct sta_info *sta,
                                                          P2P_IE_VENDOR_TYPE);
 
                if (p2p_group_notif_assoc(hapd->p2p_group, sta->addr,
-                                         ies, ies_len) < 0)
+                                         ies, ies_len) < 0) {
+                       wpa_printf(MSG_DEBUG, "P2P: Invalid P2P IE in "
+                                  "(Re)Association Request frame from "
+                                  MACSTR, MAC2STR(sta->addr));
                        return WLAN_STATUS_UNSPECIFIED_FAILURE;
+               }
        } else {
                wpabuf_free(sta->p2p_ie);
                sta->p2p_ie = NULL;
index 8e1b5ae..338d1f2 100644 (file)
@@ -323,8 +323,18 @@ int p2p_group_notif_assoc(struct p2p_group *group, const u8 *addr,
        m->client_info = p2p_build_client_info(addr, m->p2p_ie, &m->dev_capab,
                                               m->dev_addr);
        if (m->client_info == NULL) {
+               /*
+                * This can happen, e.g., when a P2P client connects to a P2P
+                * group using the infrastructure WLAN interface instead of
+                * P2P group interface. In that case, the P2P client may behave
+                * as if the GO would be a P2P Manager WLAN AP.
+                */
+               wpa_msg(group->p2p->cfg->msg_ctx, MSG_DEBUG,
+                       "P2P: Could not build Client Info from P2P IE - "
+                       "assume " MACSTR " is not a P2P client",
+                       MAC2STR(addr));
                p2p_group_free_member(m);
-               return -1;
+               return 0;
        }
 
        m->next = group->members;