[PATCH] Allow -1 as value to disable frag_threshold

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

 



To be consistent with the internal representation of how to disable
framentation, allow -1 as a value to disable it.

Signed-off-by: Matthias May <matthias.may@xxxxxxxxxxx>
---
 hostapd/config_file.c | 6 ++++--
 hostapd/hostapd.conf  | 4 ++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index 0ff315a..1569381 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -2700,8 +2700,10 @@ static int hostapd_config_fill(struct hostapd_config *conf,
 		}
 	} else if (os_strcmp(buf, "fragm_threshold") == 0) {
 		conf->fragm_threshold = atoi(pos);
-		if (conf->fragm_threshold < 256 ||
-		    conf->fragm_threshold > 2346) {
+		if (conf->fragm_threshold == -1) {
+			/* allow a value of -1 */
+		} else if (conf->fragm_threshold < 256 ||
+			   conf->fragm_threshold > 2346) {
 			wpa_printf(MSG_ERROR,
 				   "Line %d: invalid fragm_threshold %d",
 				   line, conf->fragm_threshold);
diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
index a9b7acf..583ff56 100644
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
@@ -197,11 +197,11 @@ max_num_sta=255
 # RTS threshold and 'iwconfig wlan# rts <val>' can be used to set it.
 rts_threshold=-1

-# Fragmentation threshold; 2346 = disabled (default); range 256..2346
+# Fragmentation threshold; -1 = disabled (default); range -1, 256..2346
 # If this field is not included in hostapd.conf, hostapd will not control
# fragmentation threshold and 'iwconfig wlan# frag <val>' can be used to set
 # it.
-fragm_threshold=2346
+fragm_threshold=-1

 # Rate configuration
# Default is to enable all rates supported by the hardware. This configuration
-- 2.6.1

_______________________________________________
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