]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
NAN: Fix A3 for multicast P2P2 USD
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>
Thu, 19 Dec 2024 09:18:50 +0000 (11:18 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 23 Dec 2024 10:42:21 +0000 (12:42 +0200)
According to the Wi-Fi Direct spec draft, address 3 in multicast USD
frames shall be set to wildcard BSSID (i.e., this differs from the Wi-Fi
Aware specification). Fix it.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
src/common/nan_de.c

index c38fd9ba60e06601f811c064c1ad17437168afdd..40ab9132021ae10ce9bf323f759f51f4e934958d 100644 (file)
@@ -27,6 +27,9 @@ enum nan_de_service_type {
 static const u8 p2p_network_id[ETH_ALEN] =
 { 0x51, 0x6f, 0x9a, 0x02, 0x00, 0x00 };
 
+static const u8 wildcard_bssid[ETH_ALEN] =
+{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
+
 struct nan_de_service {
        int id;
        enum nan_de_service_type type;
@@ -353,6 +356,7 @@ static void nan_de_tx_multicast(struct nan_de *de, struct nan_de_service *srv,
        enum nan_service_control_type type;
        unsigned int wait_time = 100;
        const u8 *network_id;
+       const u8 *bssid;
 
        if (srv->type == NAN_DE_PUBLISH) {
                int ms;
@@ -370,12 +374,15 @@ static void nan_de_tx_multicast(struct nan_de *de, struct nan_de_service *srv,
                return;
        }
 
-       if (srv->is_p2p)
+       if (srv->is_p2p) {
                network_id = p2p_network_id;
-       else
+               bssid = wildcard_bssid;
+       } else {
                network_id = nan_network_id;
+               bssid = nan_network_id;
+       }
 
-       nan_de_tx_sdf(de, srv, wait_time, type, network_id, network_id,
+       nan_de_tx_sdf(de, srv, wait_time, type, network_id, bssid,
                      req_instance_id, srv->ssi);
        os_get_reltime(&srv->last_multicast);
 }