P2P: Fix invitation_received callback to use NULL bssid (if not known)
authorArdong Chen <ardongchen@atheros.com>
Tue, 7 Sep 2010 14:35:42 +0000 (17:35 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 10 Sep 2010 17:30:26 +0000 (10:30 -0700)
Previously, the storage buffer for the Group BSSID was returned
regardless of whether it was included in the invitation or not.

src/p2p/p2p_invitation.c
wpa_supplicant/p2p_supplicant.c

index 052690b..7d9ac48 100644 (file)
@@ -403,7 +403,7 @@ void p2p_invitation_resp_cb(struct p2p_data *p2p, int success)
        if (success && p2p->cfg->invitation_received) {
                p2p->cfg->invitation_received(p2p->cfg->cb_ctx,
                                              p2p->inv_sa,
-                                             p2p->inv_group_bssid,
+                                             p2p->inv_group_bssid_ptr,
                                              p2p->inv_ssid, p2p->inv_ssid_len,
                                              p2p->inv_go_dev_addr,
                                              p2p->inv_status,
index efe5b60..39d6654 100644 (file)
@@ -1835,7 +1835,7 @@ static void wpas_invitation_received(void *ctx, const u8 *sa, const u8 *bssid,
                if (s) {
                        wpas_p2p_group_add_persistent(
                                wpa_s, s, s->mode == WPAS_MODE_P2P_GO, 0);
-               } else {
+               } else if (bssid) {
                        wpas_p2p_join(wpa_s, bssid, go_dev_addr,
                                      wpa_s->p2p_wps_method);
                }