From: Andrei Otcheretianski Date: Thu, 19 Dec 2024 09:18:50 +0000 (+0200) Subject: NAN: Fix A3 for multicast P2P2 USD X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50c563785f69f1a5c13267538460670dd14cae5e;p=thirdparty%2Fhostap.git NAN: Fix A3 for multicast P2P2 USD 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 --- diff --git a/src/common/nan_de.c b/src/common/nan_de.c index c38fd9ba6..40ab91320 100644 --- a/src/common/nan_de.c +++ b/src/common/nan_de.c @@ -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); }