diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c index a30859e0c..e640e9984 100644 --- a/src/ap/ap_config.c +++ b/src/ap/ap_config.c @@ -200,8 +200,8 @@ struct hostapd_config * hostapd_config_defaults(void) conf->num_bss = 1; conf->beacon_int = 100; - conf->rts_threshold = -1; /* use driver default: 2347 */ - conf->fragm_threshold = -1; /* user driver default: 2346 */ + conf->rts_threshold = -2; /* use driver default: 2347 */ + conf->fragm_threshold = -2; /* user driver default: 2346 */ /* Set to invalid value means do not add Power Constraint IE */ conf->local_pwr_constraint = -1; diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index 849d20bec..77742f441 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -1883,15 +1883,17 @@ static int hostapd_setup_interface_complete_sync(struct hostapd_iface *iface, } } - if (hapd->iconf->rts_threshold > -1 && - hostapd_set_rts(hapd, hapd->iconf->rts_threshold)) { + if (hapd->iconf->rts_threshold >= -1 && + hostapd_set_rts(hapd, hapd->iconf->rts_threshold) && + hapd->iconf->rts_threshold >= -1) { wpa_printf(MSG_ERROR, "Could not set RTS threshold for " "kernel driver"); goto fail; } - if (hapd->iconf->fragm_threshold > -1 && - hostapd_set_frag(hapd, hapd->iconf->fragm_threshold)) { + if (hapd->iconf->fragm_threshold >= -1 && + hostapd_set_frag(hapd, hapd->iconf->fragm_threshold) && + hapd->iconf->fragm_threshold != -1) { wpa_printf(MSG_ERROR, "Could not set fragmentation threshold " "for kernel driver"); goto fail; diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index e0e6fe52c..5cd4e9b5f 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -6166,7 +6166,7 @@ static int i802_set_rts(void *priv, int rts) int ret; u32 val; - if (rts >= 2347) + if (rts >= 2347 || rts == -1) val = (u32) -1; else val = rts; @@ -6194,7 +6194,7 @@ static int i802_set_frag(void *priv, int frag) int ret; u32 val; - if (frag >= 2346) + if (frag >= 2346 || frag == -1) val = (u32) -1; else val = frag;