Add option to disable broadcast deauth in hostapd on AP start/stop

The new broadcast_deauth parameter can be used to disable sending of the
Deauthentication frame whenever AP is started or stopped. The default
behavior remains identical to the past behavior (broadcast_deauth=1).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2017-02-23 00:03:00 +02:00 committed by Jouni Malinen
parent 21ed24f5ad
commit 57a2aacabf
5 changed files with 16 additions and 3 deletions

View file

@ -3673,6 +3673,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
#endif /* CONFIG_FILS */ #endif /* CONFIG_FILS */
} else if (os_strcmp(buf, "multicast_to_unicast") == 0) { } else if (os_strcmp(buf, "multicast_to_unicast") == 0) {
bss->multicast_to_unicast = atoi(pos); bss->multicast_to_unicast = atoi(pos);
} else if (os_strcmp(buf, "broadcast_deauth") == 0) {
bss->broadcast_deauth = atoi(pos);
} else { } else {
wpa_printf(MSG_ERROR, wpa_printf(MSG_ERROR,
"Line %d: unknown configuration item '%s'", "Line %d: unknown configuration item '%s'",

View file

@ -511,6 +511,10 @@ wmm_ac_vo_acm=0
# #
#multicast_to_unicast=0 #multicast_to_unicast=0
# Send broadcast Deauthentication frame on AP start/stop
# Default: 1 (enabled)
#broadcast_deauth=1
##### IEEE 802.11n related configuration ###################################### ##### IEEE 802.11n related configuration ######################################
# ieee80211n: Whether IEEE 802.11n (HT) is enabled # ieee80211n: Whether IEEE 802.11n (HT) is enabled

View file

@ -107,6 +107,8 @@ void hostapd_config_defaults_bss(struct hostapd_bss_config *bss)
bss->dhcp_server_port = DHCP_SERVER_PORT; bss->dhcp_server_port = DHCP_SERVER_PORT;
bss->dhcp_relay_port = DHCP_SERVER_PORT; bss->dhcp_relay_port = DHCP_SERVER_PORT;
#endif /* CONFIG_FILS */ #endif /* CONFIG_FILS */
bss->broadcast_deauth = 1;
} }

View file

@ -617,6 +617,8 @@ struct hostapd_bss_config {
#endif /* CONFIG_FILS */ #endif /* CONFIG_FILS */
int multicast_to_unicast; int multicast_to_unicast;
int broadcast_deauth;
}; };
/** /**

View file

@ -491,9 +491,12 @@ static int hostapd_flush_old_stations(struct hostapd_data *hapd, u16 reason)
ret = -1; ret = -1;
} }
} }
wpa_dbg(hapd->msg_ctx, MSG_DEBUG, "Deauthenticate all stations"); if (hapd->conf && hapd->conf->broadcast_deauth) {
os_memset(addr, 0xff, ETH_ALEN); wpa_dbg(hapd->msg_ctx, MSG_DEBUG,
hostapd_drv_sta_deauth(hapd, addr, reason); "Deauthenticate all stations");
os_memset(addr, 0xff, ETH_ALEN);
hostapd_drv_sta_deauth(hapd, addr, reason);
}
hostapd_free_stas(hapd); hostapd_free_stas(hapd);
return ret; return ret;