mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-02-21 11:33:04 -05:00
HE: Remove vht_ prefix from seg0/seg1_idx in DFS
These are used for both VHT and HE, so remove the misleading prefix. Signed-off-by: Shashidhar Lakkavalli <slakkavalli@datto.com> Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
parent
f428332d32
commit
7118a697f4
82
src/ap/dfs.c
82
src/ap/dfs.c
@ -232,11 +232,11 @@ static int dfs_find_channel(struct hostapd_iface *iface,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void dfs_adjust_vht_center_freq(struct hostapd_iface *iface,
|
static void dfs_adjust_center_freq(struct hostapd_iface *iface,
|
||||||
struct hostapd_channel_data *chan,
|
struct hostapd_channel_data *chan,
|
||||||
int secondary_channel,
|
int secondary_channel,
|
||||||
u8 *vht_oper_centr_freq_seg0_idx,
|
u8 *oper_centr_freq_seg0_idx,
|
||||||
u8 *vht_oper_centr_freq_seg1_idx)
|
u8 *oper_centr_freq_seg1_idx)
|
||||||
{
|
{
|
||||||
if (!iface->conf->ieee80211ac)
|
if (!iface->conf->ieee80211ac)
|
||||||
return;
|
return;
|
||||||
@ -244,32 +244,32 @@ static void dfs_adjust_vht_center_freq(struct hostapd_iface *iface,
|
|||||||
if (!chan)
|
if (!chan)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
*vht_oper_centr_freq_seg1_idx = 0;
|
*oper_centr_freq_seg1_idx = 0;
|
||||||
|
|
||||||
switch (iface->conf->vht_oper_chwidth) {
|
switch (iface->conf->vht_oper_chwidth) {
|
||||||
case CHANWIDTH_USE_HT:
|
case CHANWIDTH_USE_HT:
|
||||||
if (secondary_channel == 1)
|
if (secondary_channel == 1)
|
||||||
*vht_oper_centr_freq_seg0_idx = chan->chan + 2;
|
*oper_centr_freq_seg0_idx = chan->chan + 2;
|
||||||
else if (secondary_channel == -1)
|
else if (secondary_channel == -1)
|
||||||
*vht_oper_centr_freq_seg0_idx = chan->chan - 2;
|
*oper_centr_freq_seg0_idx = chan->chan - 2;
|
||||||
else
|
else
|
||||||
*vht_oper_centr_freq_seg0_idx = chan->chan;
|
*oper_centr_freq_seg0_idx = chan->chan;
|
||||||
break;
|
break;
|
||||||
case CHANWIDTH_80MHZ:
|
case CHANWIDTH_80MHZ:
|
||||||
*vht_oper_centr_freq_seg0_idx = chan->chan + 6;
|
*oper_centr_freq_seg0_idx = chan->chan + 6;
|
||||||
break;
|
break;
|
||||||
case CHANWIDTH_160MHZ:
|
case CHANWIDTH_160MHZ:
|
||||||
*vht_oper_centr_freq_seg0_idx = chan->chan + 14;
|
*oper_centr_freq_seg0_idx = chan->chan + 14;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
wpa_printf(MSG_INFO, "DFS only VHT20/40/80/160 is supported now");
|
wpa_printf(MSG_INFO, "DFS only VHT20/40/80/160 is supported now");
|
||||||
*vht_oper_centr_freq_seg0_idx = 0;
|
*oper_centr_freq_seg0_idx = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
wpa_printf(MSG_DEBUG, "DFS adjusting VHT center frequency: %d, %d",
|
wpa_printf(MSG_DEBUG, "DFS adjusting VHT center frequency: %d, %d",
|
||||||
*vht_oper_centr_freq_seg0_idx,
|
*oper_centr_freq_seg0_idx,
|
||||||
*vht_oper_centr_freq_seg1_idx);
|
*oper_centr_freq_seg1_idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -435,8 +435,8 @@ static int dfs_check_chans_unavailable(struct hostapd_iface *iface,
|
|||||||
static struct hostapd_channel_data *
|
static struct hostapd_channel_data *
|
||||||
dfs_get_valid_channel(struct hostapd_iface *iface,
|
dfs_get_valid_channel(struct hostapd_iface *iface,
|
||||||
int *secondary_channel,
|
int *secondary_channel,
|
||||||
u8 *vht_oper_centr_freq_seg0_idx,
|
u8 *oper_centr_freq_seg0_idx,
|
||||||
u8 *vht_oper_centr_freq_seg1_idx,
|
u8 *oper_centr_freq_seg1_idx,
|
||||||
int skip_radar)
|
int skip_radar)
|
||||||
{
|
{
|
||||||
struct hostapd_hw_modes *mode;
|
struct hostapd_hw_modes *mode;
|
||||||
@ -447,8 +447,8 @@ dfs_get_valid_channel(struct hostapd_iface *iface,
|
|||||||
|
|
||||||
wpa_printf(MSG_DEBUG, "DFS: Selecting random channel");
|
wpa_printf(MSG_DEBUG, "DFS: Selecting random channel");
|
||||||
*secondary_channel = 0;
|
*secondary_channel = 0;
|
||||||
*vht_oper_centr_freq_seg0_idx = 0;
|
*oper_centr_freq_seg0_idx = 0;
|
||||||
*vht_oper_centr_freq_seg1_idx = 0;
|
*oper_centr_freq_seg1_idx = 0;
|
||||||
|
|
||||||
if (iface->current_mode == NULL)
|
if (iface->current_mode == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -473,10 +473,10 @@ dfs_get_valid_channel(struct hostapd_iface *iface,
|
|||||||
else
|
else
|
||||||
*secondary_channel = 0;
|
*secondary_channel = 0;
|
||||||
|
|
||||||
dfs_adjust_vht_center_freq(iface, chan,
|
dfs_adjust_center_freq(iface, chan,
|
||||||
*secondary_channel,
|
*secondary_channel,
|
||||||
vht_oper_centr_freq_seg0_idx,
|
oper_centr_freq_seg0_idx,
|
||||||
vht_oper_centr_freq_seg1_idx);
|
oper_centr_freq_seg1_idx);
|
||||||
|
|
||||||
return chan;
|
return chan;
|
||||||
}
|
}
|
||||||
@ -842,16 +842,16 @@ static int hostapd_dfs_start_channel_switch_cac(struct hostapd_iface *iface)
|
|||||||
{
|
{
|
||||||
struct hostapd_channel_data *channel;
|
struct hostapd_channel_data *channel;
|
||||||
int secondary_channel;
|
int secondary_channel;
|
||||||
u8 vht_oper_centr_freq_seg0_idx = 0;
|
u8 oper_centr_freq_seg0_idx = 0;
|
||||||
u8 vht_oper_centr_freq_seg1_idx = 0;
|
u8 oper_centr_freq_seg1_idx = 0;
|
||||||
int skip_radar = 0;
|
int skip_radar = 0;
|
||||||
int err = 1;
|
int err = 1;
|
||||||
|
|
||||||
/* Radar detected during active CAC */
|
/* Radar detected during active CAC */
|
||||||
iface->cac_started = 0;
|
iface->cac_started = 0;
|
||||||
channel = dfs_get_valid_channel(iface, &secondary_channel,
|
channel = dfs_get_valid_channel(iface, &secondary_channel,
|
||||||
&vht_oper_centr_freq_seg0_idx,
|
&oper_centr_freq_seg0_idx,
|
||||||
&vht_oper_centr_freq_seg1_idx,
|
&oper_centr_freq_seg1_idx,
|
||||||
skip_radar);
|
skip_radar);
|
||||||
|
|
||||||
if (!channel) {
|
if (!channel) {
|
||||||
@ -868,10 +868,8 @@ static int hostapd_dfs_start_channel_switch_cac(struct hostapd_iface *iface)
|
|||||||
iface->freq = channel->freq;
|
iface->freq = channel->freq;
|
||||||
iface->conf->channel = channel->chan;
|
iface->conf->channel = channel->chan;
|
||||||
iface->conf->secondary_channel = secondary_channel;
|
iface->conf->secondary_channel = secondary_channel;
|
||||||
iface->conf->vht_oper_centr_freq_seg0_idx =
|
iface->conf->vht_oper_centr_freq_seg0_idx = oper_centr_freq_seg0_idx;
|
||||||
vht_oper_centr_freq_seg0_idx;
|
iface->conf->vht_oper_centr_freq_seg1_idx = oper_centr_freq_seg1_idx;
|
||||||
iface->conf->vht_oper_centr_freq_seg1_idx =
|
|
||||||
vht_oper_centr_freq_seg1_idx;
|
|
||||||
err = 0;
|
err = 0;
|
||||||
|
|
||||||
hostapd_setup_interface_complete(iface, err);
|
hostapd_setup_interface_complete(iface, err);
|
||||||
@ -883,8 +881,8 @@ static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface)
|
|||||||
{
|
{
|
||||||
struct hostapd_channel_data *channel;
|
struct hostapd_channel_data *channel;
|
||||||
int secondary_channel;
|
int secondary_channel;
|
||||||
u8 vht_oper_centr_freq_seg0_idx;
|
u8 oper_centr_freq_seg0_idx;
|
||||||
u8 vht_oper_centr_freq_seg1_idx;
|
u8 oper_centr_freq_seg1_idx;
|
||||||
int skip_radar = 1;
|
int skip_radar = 1;
|
||||||
struct csa_settings csa_settings;
|
struct csa_settings csa_settings;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
@ -911,8 +909,8 @@ static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface)
|
|||||||
|
|
||||||
/* Perform channel switch/CSA */
|
/* Perform channel switch/CSA */
|
||||||
channel = dfs_get_valid_channel(iface, &secondary_channel,
|
channel = dfs_get_valid_channel(iface, &secondary_channel,
|
||||||
&vht_oper_centr_freq_seg0_idx,
|
&oper_centr_freq_seg0_idx,
|
||||||
&vht_oper_centr_freq_seg1_idx,
|
&oper_centr_freq_seg1_idx,
|
||||||
skip_radar);
|
skip_radar);
|
||||||
|
|
||||||
if (!channel) {
|
if (!channel) {
|
||||||
@ -923,8 +921,8 @@ static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface)
|
|||||||
*/
|
*/
|
||||||
skip_radar = 0;
|
skip_radar = 0;
|
||||||
channel = dfs_get_valid_channel(iface, &secondary_channel,
|
channel = dfs_get_valid_channel(iface, &secondary_channel,
|
||||||
&vht_oper_centr_freq_seg0_idx,
|
&oper_centr_freq_seg0_idx,
|
||||||
&vht_oper_centr_freq_seg1_idx,
|
&oper_centr_freq_seg1_idx,
|
||||||
skip_radar);
|
skip_radar);
|
||||||
if (!channel) {
|
if (!channel) {
|
||||||
wpa_printf(MSG_INFO,
|
wpa_printf(MSG_INFO,
|
||||||
@ -937,9 +935,9 @@ static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface)
|
|||||||
iface->conf->channel = channel->chan;
|
iface->conf->channel = channel->chan;
|
||||||
iface->conf->secondary_channel = secondary_channel;
|
iface->conf->secondary_channel = secondary_channel;
|
||||||
iface->conf->vht_oper_centr_freq_seg0_idx =
|
iface->conf->vht_oper_centr_freq_seg0_idx =
|
||||||
vht_oper_centr_freq_seg0_idx;
|
oper_centr_freq_seg0_idx;
|
||||||
iface->conf->vht_oper_centr_freq_seg1_idx =
|
iface->conf->vht_oper_centr_freq_seg1_idx =
|
||||||
vht_oper_centr_freq_seg1_idx;
|
oper_centr_freq_seg1_idx;
|
||||||
|
|
||||||
hostapd_disable_iface(iface);
|
hostapd_disable_iface(iface);
|
||||||
hostapd_enable_iface(iface);
|
hostapd_enable_iface(iface);
|
||||||
@ -964,8 +962,8 @@ static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface)
|
|||||||
iface->conf->ieee80211ac,
|
iface->conf->ieee80211ac,
|
||||||
secondary_channel,
|
secondary_channel,
|
||||||
iface->conf->vht_oper_chwidth,
|
iface->conf->vht_oper_chwidth,
|
||||||
vht_oper_centr_freq_seg0_idx,
|
oper_centr_freq_seg0_idx,
|
||||||
vht_oper_centr_freq_seg1_idx,
|
oper_centr_freq_seg1_idx,
|
||||||
iface->current_mode->vht_capab);
|
iface->current_mode->vht_capab);
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
@ -987,9 +985,9 @@ static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface)
|
|||||||
iface->conf->channel = channel->chan;
|
iface->conf->channel = channel->chan;
|
||||||
iface->conf->secondary_channel = secondary_channel;
|
iface->conf->secondary_channel = secondary_channel;
|
||||||
iface->conf->vht_oper_centr_freq_seg0_idx =
|
iface->conf->vht_oper_centr_freq_seg0_idx =
|
||||||
vht_oper_centr_freq_seg0_idx;
|
oper_centr_freq_seg0_idx;
|
||||||
iface->conf->vht_oper_centr_freq_seg1_idx =
|
iface->conf->vht_oper_centr_freq_seg1_idx =
|
||||||
vht_oper_centr_freq_seg1_idx;
|
oper_centr_freq_seg1_idx;
|
||||||
|
|
||||||
hostapd_disable_iface(iface);
|
hostapd_disable_iface(iface);
|
||||||
hostapd_enable_iface(iface);
|
hostapd_enable_iface(iface);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user