]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP: Determine Short SSID value for the BSS
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>
Wed, 19 Jun 2019 12:49:15 +0000 (15:49 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 28 Dec 2019 20:32:14 +0000 (22:32 +0200)
This can be used in the future to implement support for RNR and scanning
extensions using a shorter field for the SSID.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
hostapd/Android.mk
hostapd/Makefile
src/ap/ap_config.h
src/ap/hostapd.c
wpa_supplicant/Android.mk
wpa_supplicant/Makefile

index a87ac81444dc1785e54728df46399de1d6318332..82fa3ea73352be17b7045bedb6a4920d87234db1 100644 (file)
@@ -145,6 +145,7 @@ OBJS += src/utils/wpa_debug.c
 OBJS += src/utils/wpabuf.c
 OBJS += src/utils/os_$(CONFIG_OS).c
 OBJS += src/utils/ip_addr.c
+OBJS += src/utils/crc32.c
 
 OBJS += src/common/ieee802_11_common.c
 OBJS += src/common/wpa_common.c
index 955e27856401637f7e4b0224c935cd9df45bab18..f1896f2e3d53be086d7ba053d4d91e52f34b47b1 100644 (file)
@@ -158,6 +158,7 @@ OBJS_c += ../src/utils/wpa_debug.o
 OBJS += ../src/utils/wpabuf.o
 OBJS += ../src/utils/os_$(CONFIG_OS).o
 OBJS += ../src/utils/ip_addr.o
+OBJS += ../src/utils/crc32.o
 
 OBJS += ../src/common/ieee802_11_common.o
 OBJS += ../src/common/wpa_common.o
index 83b8aee65871802701951f9daf0c1900b3c11492..7e4b9262c5fecdd17335cd486ed3ca290278d8a4 100644 (file)
@@ -88,6 +88,7 @@ typedef enum hostap_security_policy {
 struct hostapd_ssid {
        u8 ssid[SSID_MAX_LEN];
        size_t ssid_len;
+       u32 short_ssid;
        unsigned int ssid_set:1;
        unsigned int utf8_ssid:1;
        unsigned int wpa_passphrase_set:1;
index e4950e3edf02c71ff70d4b0205ff8602c5982f79..516d571ae2bb1639bd517e3d3a7c37522c6ec2a0 100644 (file)
@@ -13,6 +13,7 @@
 
 #include "utils/common.h"
 #include "utils/eloop.h"
+#include "utils/crc32.h"
 #include "common/ieee802_11_defs.h"
 #include "common/wpa_ctrl.h"
 #include "common/hw_features_common.h"
@@ -1190,6 +1191,12 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first)
                os_memcpy(conf->ssid.ssid, ssid, conf->ssid.ssid_len);
        }
 
+       /*
+        * Short SSID calculation is identical to FCS and it is defined in
+        * IEEE P802.11-REVmd/D3.0, 9.4.2.170.3 (Calculating the Short-SSID).
+        */
+       conf->ssid.short_ssid = crc32(conf->ssid.ssid, conf->ssid.ssid_len);
+
        if (!hostapd_drv_none(hapd)) {
                wpa_printf(MSG_ERROR, "Using interface %s with hwaddr " MACSTR
                           " and ssid \"%s\"",
index cd93d48b9cbb9edd228399a249ad3a6e35498966..98f3b52a25df61b93838dd2adc3b1417bccc2812 100644 (file)
@@ -94,6 +94,7 @@ OBJS += src/utils/wpa_debug.c
 OBJS += src/utils/wpabuf.c
 OBJS += src/utils/bitfield.c
 OBJS += src/utils/ip_addr.c
+OBJS += src/utils/crc32.c
 OBJS += wmm_ac.c
 OBJS += op_classes.c
 OBJS += rrm.c
index 94f9165bbc028377ca82590451e2313fbe648607..96dc5bd0f88f895d971099a0c1d21cb45ca994ca 100644 (file)
@@ -104,6 +104,7 @@ OBJS += ../src/utils/wpa_debug.o
 OBJS += ../src/utils/wpabuf.o
 OBJS += ../src/utils/bitfield.o
 OBJS += ../src/utils/ip_addr.o
+OBJS += ../src/utils/crc32.o
 OBJS += op_classes.o
 OBJS += rrm.o
 OBJS_p = wpa_passphrase.o