Re: [PATCH 05/13] mbssid: add multiple BSSID elements

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/7/2022 1:30 PM, Jouni Malinen wrote:
On Wed, Mar 02, 2022 at 02:26:26PM -0800, Aloka Dixit wrote:
Add data as per IEEE Std 802.11-2020 9.4.2.45 Multiple BSSID element.
Include this element in beacons and probe response frames when mbssid
is enabled. Split the BSSes into multiple elements if the data
does not fit in 255 bytes allowed for a single element.


@@ -462,8 +510,11 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd,
+	buflen += hostapd_eid_mbssid_len(hapd, WLAN_FC_STYPE_PROBE_RESP, NULL);
...
+	pos = hostapd_eid_mbssid(hapd, pos, epos, WLAN_FC_STYPE_PROBE_RESP, 0,
+				 NULL);

Is there something preventing the case of this Probe Response frame
ending up being too long to fit within the maximum MMPDU length if there
is a large number of nontransmitted BSSIDs?


Hi Jouni,

Not really, but in practice I haven't seen it overflowing yet with 16 BSSes with currently supported data.

Please let me know if you think we should add extra length checks here.

+
+static size_t hostapd_eid_mbssid_elem_len(struct hostapd_data *hapd,
+					  u32 frame_type, size_t *bss_index)
+{
+	size_t len = 3, i;
+
+	for (i = *bss_index; i < hapd->iface->num_bss; i++) {
+		struct hostapd_data *bss = hapd->iface->bss[i];
+		const u8 *auth, *rsn, *rsnx;
+		size_t nontx_profile_len, auth_len;
+
+		if (!bss || !bss->conf || !bss->started)
+			continue;
+
+		/*
+		 * Sublement ID: 1 byte
+		 * Length: 1 byte
+		 * Nontransmitted capabilities: 4 bytes
+		 * SSID element: 2 + variable
+		 * Multiple BSSID Index Element: 3 bytes (+2 bytes in beacons)
+		 * Fixed length = 1 + 1 + 4 + 2 + 3 = 11
+		 */
+		nontx_profile_len = 11 + bss->conf->ssid.ssid_len;
+
+		if (frame_type == WLAN_FC_STYPE_BEACON)
+			nontx_profile_len += 2;
+
+		auth = wpa_auth_get_wpa_ie(bss->wpa_auth, &auth_len);
+		if (auth) {
+			rsn = get_ie(auth, auth_len, WLAN_EID_RSN);
+			if (rsn)
+				nontx_profile_len += (2 + rsn[1]);
+
+			rsnx = get_ie(auth, auth_len, WLAN_EID_RSNX);
+			if (rsnx)
+				nontx_profile_len += (2 + rsnx[1]);
+		}

Are those all the elements that are needed here? There seems to be a lot
of other things that could differ between the nontransmitted BSSIDs and
the transmitted BSSID. The same would obviously apply to
hostapd_eid_mbssid_elem() below.


Radio properties are same as the transmitting one.
I have currently included the details required for a successful association with a non-transmitting profile. It is not possible to cover all elements without enabling all advanced features. So I hope that whoever enables particular feature with MBSSID will take care of modifying this function as well.

diff --git a/src/drivers/driver.h b/src/drivers/driver.h
+	/**
+	 * mbssid_elem - Buffer containing all multiple BSSID elements
+	 */
+	u8 *mbssid_elem;

Should that be const u8 * instead?


No, this field is similar to head, tail etc in the same struct. Warning is seen if os_free() is called on a 'const' pointer.

+	/**
+	 * mbssid_elem_offset - Offsets to elements in mbssid_elem.
+	 * Kernel will use these offsets to generate multiple BSSID beacons.
+	 */
+	u8 **mbssid_elem_offset;

const?


Same as above.

Thanks.

_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux