]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Send response frame on channel where the request is received
authorQiwei Cai <quic_qcai@quicinc.com>
Wed, 5 Jan 2022 05:04:24 +0000 (13:04 +0800)
committerJouni Malinen <j@w1.fi>
Mon, 17 Jan 2022 18:27:37 +0000 (20:27 +0200)
The rx_freq of Public Action frame was not maintained by the GO and the
GO always sent the response on the operating channel. This causes
provision discovery failure when a P2P Device is sending a PD Request on
a 2.4 GHz social channel and the GO is responding on a 5 GHz operating
channel.

Save the rx_freq and use it for GO to sent the response. This extends
commit c5cc7a59acb2 ("Report offchannel RX frame frequency to hostapd")
to cover additional frame types.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
src/ap/ieee802_11.c
wpa_supplicant/ap.c

index db41049287fcc4b634a95e576d3a2177c5aae6cc..f6329253766c674f67976ea1674ce103496dc6a5 100644 (file)
@@ -6098,19 +6098,17 @@ static int handle_action(struct hostapd_data *hapd,
                        end = ((const u8 *) mgmt) + len;
                        gas_query_ap_rx(hapd->gas, mgmt->sa,
                                        mgmt->u.action.category,
-                                       pos, end - pos, hapd->iface->freq);
+                                       pos, end - pos, freq);
                        return 1;
                }
 #endif /* CONFIG_DPP */
                if (hapd->public_action_cb) {
                        hapd->public_action_cb(hapd->public_action_cb_ctx,
-                                              (u8 *) mgmt, len,
-                                              hapd->iface->freq);
+                                              (u8 *) mgmt, len, freq);
                }
                if (hapd->public_action_cb2) {
                        hapd->public_action_cb2(hapd->public_action_cb2_ctx,
-                                               (u8 *) mgmt, len,
-                                               hapd->iface->freq);
+                                               (u8 *) mgmt, len, freq);
                }
                if (hapd->public_action_cb || hapd->public_action_cb2)
                        return 1;
@@ -6118,8 +6116,7 @@ static int handle_action(struct hostapd_data *hapd,
        case WLAN_ACTION_VENDOR_SPECIFIC:
                if (hapd->vendor_action_cb) {
                        if (hapd->vendor_action_cb(hapd->vendor_action_cb_ctx,
-                                                  (u8 *) mgmt, len,
-                                                  hapd->iface->freq) == 0)
+                                                  (u8 *) mgmt, len, freq) == 0)
                                return 1;
                }
                break;
index 37d39e6744ecd13c2abbb6ea2e3babdd31415711..ad2cf5f1123048f7263ba94aead94327d4842e35 100644 (file)
@@ -1203,6 +1203,7 @@ void ap_mgmt_rx(void *ctx, struct rx_mgmt *rx_mgmt)
        struct wpa_supplicant *wpa_s = ctx;
        struct hostapd_frame_info fi;
        os_memset(&fi, 0, sizeof(fi));
+       fi.freq = rx_mgmt->freq;
        fi.datarate = rx_mgmt->datarate;
        fi.ssi_signal = rx_mgmt->ssi_signal;
        ieee802_11_mgmt(wpa_s->ap_iface->bss[0], rx_mgmt->frame,