wlan-ap-Telecominfraproject/feeds/wifi-ax/hostapd/patches/e00-009-fix-reduced-neighbor-report-length.patch
John Crispin 528a778e38 open-converged-wireless: Import 21.02 based uCentral tree
Signed-off-by: John Crispin <john@phrozen.org>
2021-03-25 12:19:47 +01:00

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