mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-17 17:31:27 +00:00
59 lines
1.7 KiB
Diff
59 lines
1.7 KiB
Diff
From 2fc69199a935c06c95f9b2766a4ec30208478720 Mon Sep 17 00:00:00 2001
|
|
From: Aloka Dixit <alokad@codeaurora.org>
|
|
Date: Wed, 30 Sep 2020 20:41:54 -0700
|
|
Subject: [PATCH] hostapd: Fix reduced neighbor report length
|
|
|
|
The function hostapd_eid_reduced_neighbor_report_len() doesn't include 2
|
|
bytes for the element ID and length fields which results in failure to
|
|
set beacon when more than basic features are enabled.
|
|
|
|
This patch fixes this error which was found after enabling radio
|
|
measurement capabilities.
|
|
|
|
Signed-off-by: Aloka Dixit <alokad@codeaurora.org>
|
|
---
|
|
src/ap/ieee802_11.c | 8 +++++++-
|
|
1 file changed, 7 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
|
|
index 65a556e3a606..806e8b02b732 100644
|
|
--- a/src/ap/ieee802_11.c
|
|
+++ b/src/ap/ieee802_11.c
|
|
@@ -5771,6 +5771,8 @@ size_t hostapd_eid_reduced_neighbor_report_len(struct hostapd_data *hapd)
|
|
len += TBTT_HEADER_LENGTH + ((hapd->iface->num_bss - 1) * TBTT_INFO_LENGTH);
|
|
if (!dl_list_empty(&hapd->nr_db))
|
|
len += dl_list_len(&hapd->nr_db) * (TBTT_HEADER_LENGTH + TBTT_INFO_LENGTH);
|
|
+ if (len)
|
|
+ len += 2; /* Element ID and length */
|
|
|
|
return len;
|
|
}
|
|
@@ -5781,12 +5783,13 @@ u8 * hostapd_eid_reduced_neighbor_report(struct hostapd_data *hapd, u8 *eid)
|
|
size_t len = hostapd_eid_reduced_neighbor_report_len(hapd);
|
|
struct hostapd_neighbor_entry *nr;
|
|
int i, count = 0;
|
|
+ u8 *size_offset;
|
|
|
|
if (!len)
|
|
return eid;
|
|
|
|
*eid++ = WLAN_EID_REDUCED_NEIGHBOR_REPORT;
|
|
- *eid++ = len;
|
|
+ size_offset = eid++;
|
|
|
|
if (hapd->iface->num_bss > 1) {
|
|
u8 op_class, channel;
|
|
@@ -5848,6 +5851,9 @@ nr_db:
|
|
|
|
if (!count)
|
|
eid -= 2;
|
|
+ else
|
|
+ *size_offset = (eid - size_offset) - 1;
|
|
+
|
|
return eid;
|
|
}
|
|
|
|
--
|
|
2.25.0
|
|
|