developer | 29c4d2d | 2022-12-26 19:41:22 +0800 | [diff] [blame] | 1 | From c9304d3303d563ad6d2619f4e07864ed12f96889 Mon Sep 17 00:00:00 2001 |
| 2 | From: David Bauer <mail@david-bauer.net> |
| 3 | Date: Sat, 14 May 2022 21:41:03 +0200 |
| 4 | Subject: [PATCH] hostapd: config: support random BSS color |
| 5 | |
| 6 | Configure the HE BSS color to a random value in case the config defines |
| 7 | a BSS color which exceeds the max BSS color (63). |
| 8 | |
| 9 | Signed-off-by: David Bauer <mail@david-bauer.net> |
| 10 | --- |
| 11 | hostapd/config_file.c | 2 ++ |
| 12 | 1 file changed, 2 insertions(+) |
| 13 | |
| 14 | --- a/hostapd/config_file.c |
| 15 | +++ b/hostapd/config_file.c |
developer | 8bff647 | 2023-07-17 11:11:44 +0800 | [diff] [blame] | 16 | @@ -3500,6 +3500,8 @@ static int hostapd_config_fill(struct ho |
developer | 29c4d2d | 2022-12-26 19:41:22 +0800 | [diff] [blame] | 17 | } else if (os_strcmp(buf, "he_bss_color") == 0) { |
| 18 | conf->he_op.he_bss_color = atoi(pos) & 0x3f; |
| 19 | conf->he_op.he_bss_color_disabled = 0; |
| 20 | + if (atoi(pos) > 63) |
| 21 | + conf->he_op.he_bss_color = os_random() % 63 + 1; |
| 22 | } else if (os_strcmp(buf, "he_bss_color_partial") == 0) { |
| 23 | conf->he_op.he_bss_color_partial = atoi(pos); |
| 24 | } else if (os_strcmp(buf, "he_default_pe_duration") == 0) { |