[PATCH 3/5] AP: Allow hex format for puncturing bitmap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It is much more convinient to specify the bitmap as a hex value.
Allow it.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@xxxxxxxxx>
---
 hostapd/config_file.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index 1a49292b11..3d356e617a 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -4768,8 +4768,20 @@ static int hostapd_config_fill(struct hostapd_config *conf,
 		conf->eht_phy_capab.mu_beamformer = atoi(pos);
 	} else if (os_strcmp(buf, "eht_default_pe_duration") == 0) {
 		conf->eht_default_pe_duration = atoi(pos);
-	} else if (os_strcmp(buf, "punct_bitmap") == 0) {
-		conf->punct_bitmap = atoi(pos);
+#define PARSE_FORCE_U16(_config, _val)				\
+	} else if (os_strcmp(buf, #_val) == 0) {		\
+		char *end;					\
+		long int val = strtol(pos, &end, 0);		\
+								\
+		if (*end || val < 0 || val > 0xffff) {		\
+			wpa_printf(MSG_ERROR,			\
+				   "Line %d: Invalid value '%s'", \
+				   line, pos);			\
+			return 1;				\
+		}						\
+								\
+		_config->_val = val;
+	PARSE_FORCE_U16(conf, punct_bitmap)
 	} else if (os_strcmp(buf, "punct_acs_threshold") == 0) {
 		int val = atoi(pos);
 
-- 
2.43.0


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux