hostapd: config: support random BSS color

Configure the HE BSS color to a random value in case the config defines
a BSS color which exceeds the max BSS color (63).

Signed-off-by: David Bauer <mail@david-bauer.net>
This commit is contained in:
David Bauer 2022-05-14 21:41:03 +02:00 committed by sinavir
parent d6138a763b
commit f9d49d7408
No known key found for this signature in database

View file

@ -3801,6 +3801,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
} else if (os_strcmp(buf, "he_bss_color") == 0) { } else if (os_strcmp(buf, "he_bss_color") == 0) {
conf->he_op.he_bss_color = atoi(pos) & 0x3f; conf->he_op.he_bss_color = atoi(pos) & 0x3f;
conf->he_op.he_bss_color_disabled = 0; conf->he_op.he_bss_color_disabled = 0;
if (atoi(pos) > 63)
conf->he_op.he_bss_color = os_random() % 63 + 1;
} else if (os_strcmp(buf, "he_bss_color_partial") == 0) { } else if (os_strcmp(buf, "he_bss_color_partial") == 0) {
conf->he_op.he_bss_color_partial = atoi(pos); conf->he_op.he_bss_color_partial = atoi(pos);
} else if (os_strcmp(buf, "he_default_pe_duration") == 0) { } else if (os_strcmp(buf, "he_default_pe_duration") == 0) {