[PATCH 3/4] RNR: add short_ssid to neighbor_db entries

John Crispin john at phrozen.org
Wed Jun 24 09:12:11 EDT 2020


The RNR IE requires this field.

Signed-off-by: John Crispin <john at phrozen.org>
---
 src/ap/hostapd.h     | 1 +
 src/ap/neighbor_db.c | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
index b84627bf5..543041d96 100644
--- a/src/ap/hostapd.h
+++ b/src/ap/hostapd.h
@@ -139,6 +139,7 @@ struct hostapd_neighbor_entry {
 	struct os_time lci_date;
 	int stationary;
 	u8 bss_parameters;
+	u32 short_ssid;
 };
 
 struct hostapd_sae_commit_queue {
diff --git a/src/ap/neighbor_db.c b/src/ap/neighbor_db.c
index 41d0d1d15..0429be086 100644
--- a/src/ap/neighbor_db.c
+++ b/src/ap/neighbor_db.c
@@ -10,6 +10,7 @@
 #include "utils/includes.h"
 
 #include "utils/common.h"
+#include "utils/crc32.h"
 #include "hostapd.h"
 #include "ieee802_11.h"
 #include "neighbor_db.h"
@@ -135,6 +136,7 @@ int hostapd_neighbor_set(struct hostapd_data *hapd, const u8 *bssid,
 
 	os_memcpy(entry->bssid, bssid, ETH_ALEN);
 	os_memcpy(&entry->ssid, ssid, sizeof(entry->ssid));
+	entry->short_ssid = crc32(ssid->ssid, ssid->ssid_len);
 
 	entry->nr = wpabuf_dup(nr);
 	if (!entry->nr)
-- 
2.25.1




More information about the Hostap mailing list