summaryrefslogtreecommitdiff
path: root/hostapd
diff options
context:
space:
mode:
authorAndrej Shadura <andrew.shadura@collabora.co.uk>2021-11-17 21:39:29 +0100
committerAndrej Shadura <andrew.shadura@collabora.co.uk>2021-11-17 21:39:29 +0100
commit1d9972bd9d40169994c0b089c107c0f56d3912fb (patch)
treeac5692be139e11b347e2efc79178651e1b90bae7 /hostapd
parentd42f0ed0a242a49f847bee6d62d6a528240042bc (diff)
New upstream version 2.9.0+git20211116+0b853303ae31
Diffstat (limited to 'hostapd')
-rw-r--r--hostapd/config_file.c23
-rw-r--r--hostapd/ctrl_iface.c33
-rw-r--r--hostapd/hostapd.conf5
3 files changed, 43 insertions, 18 deletions
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index 7b03edf..daf3f37 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -13,6 +13,7 @@
#include "utils/common.h"
#include "utils/uuid.h"
+#include "utils/crc32.h"
#include "common/ieee802_11_defs.h"
#include "common/sae.h"
#include "crypto/sha256.h"
@@ -2396,16 +2397,19 @@ static int hostapd_config_fill(struct hostapd_config *conf,
wpa_printf(MSG_INFO, "Line %d: DEPRECATED: 'dump_file' configuration variable is not used anymore",
line);
} else if (os_strcmp(buf, "ssid") == 0) {
- bss->ssid.ssid_len = os_strlen(pos);
- if (bss->ssid.ssid_len > SSID_MAX_LEN ||
- bss->ssid.ssid_len < 1) {
+ struct hostapd_ssid *ssid = &bss->ssid;
+
+ ssid->ssid_len = os_strlen(pos);
+ if (ssid->ssid_len > SSID_MAX_LEN || ssid->ssid_len < 1) {
wpa_printf(MSG_ERROR, "Line %d: invalid SSID '%s'",
line, pos);
return 1;
}
- os_memcpy(bss->ssid.ssid, pos, bss->ssid.ssid_len);
- bss->ssid.ssid_set = 1;
+ os_memcpy(ssid->ssid, pos, ssid->ssid_len);
+ ssid->ssid_set = 1;
+ ssid->short_ssid = crc32(ssid->ssid, ssid->ssid_len);
} else if (os_strcmp(buf, "ssid2") == 0) {
+ struct hostapd_ssid *ssid = &bss->ssid;
size_t slen;
char *str = wpa_config_parse_string(pos, &slen);
if (str == NULL || slen < 1 || slen > SSID_MAX_LEN) {
@@ -2414,9 +2418,10 @@ static int hostapd_config_fill(struct hostapd_config *conf,
os_free(str);
return 1;
}
- os_memcpy(bss->ssid.ssid, str, slen);
- bss->ssid.ssid_len = slen;
- bss->ssid.ssid_set = 1;
+ os_memcpy(ssid->ssid, str, slen);
+ ssid->ssid_len = slen;
+ ssid->ssid_set = 1;
+ ssid->short_ssid = crc32(ssid->ssid, ssid->ssid_len);
os_free(str);
} else if (os_strcmp(buf, "utf8_ssid") == 0) {
bss->ssid.utf8_ssid = atoi(pos) > 0;
@@ -4707,6 +4712,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
if (get_hex_config(bss->ext_capa, EXT_CAPA_MAX_LEN,
line, "ext_capa", pos))
return 1;
+ } else if (os_strcmp(buf, "rnr") == 0) {
+ bss->rnr = atoi(pos);
} else {
wpa_printf(MSG_ERROR,
"Line %d: unknown configuration item '%s'",
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
index 280e94f..6c99a31 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
@@ -840,7 +840,7 @@ static int hostapd_ctrl_iface_bss_tm_req(struct hostapd_data *hapd,
const char *pos, *end;
int disassoc_timer = 0;
struct sta_info *sta;
- u8 req_mode = 0, valid_int = 0x01;
+ u8 req_mode = 0, valid_int = 0x01, dialog_token = 0x01;
u8 bss_term_dur[12];
char *url = NULL;
int ret;
@@ -878,6 +878,12 @@ static int hostapd_ctrl_iface_bss_tm_req(struct hostapd_data *hapd,
valid_int = atoi(pos);
}
+ pos = os_strstr(cmd, " dialog_token=");
+ if (pos) {
+ pos += 14;
+ dialog_token = atoi(pos);
+ }
+
pos = os_strstr(cmd, " bss_term=");
if (pos) {
pos += 10;
@@ -984,7 +990,7 @@ static int hostapd_ctrl_iface_bss_tm_req(struct hostapd_data *hapd,
#endif /* CONFIG_MBO */
ret = wnm_send_bss_tm_req(hapd, sta, req_mode, disassoc_timer,
- valid_int, bss_term_dur, url,
+ valid_int, bss_term_dur, dialog_token, url,
nei_len ? nei_rep : NULL, nei_len,
mbo_len ? mbo : NULL, mbo_len);
#ifdef CONFIG_MBO
@@ -3185,8 +3191,9 @@ static int hostapd_ctrl_iface_set_neighbor(struct hostapd_data *hapd, char *buf)
u8 bssid[ETH_ALEN];
struct wpabuf *nr, *lci = NULL, *civic = NULL;
int stationary = 0;
+ int bss_parameters = 0;
char *tmp;
- int ret;
+ int ret = -1;
if (!(hapd->conf->radio_measurements[0] &
WLAN_RRM_CAPS_NEIGHBOR_REPORT)) {
@@ -3240,8 +3247,7 @@ static int hostapd_ctrl_iface_set_neighbor(struct hostapd_data *hapd, char *buf)
if (!lci) {
wpa_printf(MSG_ERROR,
"CTRL: SET_NEIGHBOR: Bad LCI subelement");
- wpabuf_free(nr);
- return -1;
+ goto fail;
}
}
@@ -3257,9 +3263,7 @@ static int hostapd_ctrl_iface_set_neighbor(struct hostapd_data *hapd, char *buf)
if (!civic) {
wpa_printf(MSG_ERROR,
"CTRL: SET_NEIGHBOR: Bad civic subelement");
- wpabuf_free(nr);
- wpabuf_free(lci);
- return -1;
+ goto fail;
}
}
@@ -3269,10 +3273,21 @@ static int hostapd_ctrl_iface_set_neighbor(struct hostapd_data *hapd, char *buf)
if (os_strstr(buf, "stat"))
stationary = 1;
+ tmp = os_strstr(buf, "bss_parameter=");
+ if (tmp) {
+ bss_parameters = atoi(tmp + 14);
+ if (bss_parameters < 0 || bss_parameters > 0xff) {
+ wpa_printf(MSG_ERROR,
+ "CTRL: SET_NEIGHBOR: Bad bss_parameters subelement");
+ goto fail;
+ }
+ }
+
set:
ret = hostapd_neighbor_set(hapd, bssid, &ssid, nr, lci, civic,
- stationary);
+ stationary, bss_parameters);
+fail:
wpabuf_free(nr);
wpabuf_free(lci);
wpabuf_free(civic);
diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
index dbdd3d7..67d4cef 100644
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
@@ -1837,7 +1837,7 @@ own_ip_addr=127.0.0.1
#assoc_sa_query_retry_timeout=201
# ocv: Operating Channel Validation
-# This is a countermeasure against multi-channel man-in-the-middle attacks.
+# This is a countermeasure against multi-channel on-path attacks.
# Enabling this depends on the driver's support for OCV when the driver SME is
# used. If hostapd SME is used, this will be enabled just based on this
# configuration.
@@ -2921,6 +2921,9 @@ own_ip_addr=127.0.0.1
# that allows sending of such data. Default: 0.
#stationary_ap=0
+# Enable reduced neighbor reporting (RNR)
+#rnr=0
+
##### Airtime policy configuration ###########################################
# Set the airtime policy operating mode: