]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add option to disable broadcast deauth in hostapd on AP start/stop
authorJouni Malinen <jouni@qca.qualcomm.com>
Wed, 22 Feb 2017 22:03:00 +0000 (00:03 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 26 Feb 2017 10:05:40 +0000 (12:05 +0200)
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>
hostapd/config_file.c
hostapd/hostapd.conf
src/ap/ap_config.c
src/ap/ap_config.h
src/ap/hostapd.c

index 9e954400e795d3e0e24f936480a9f95350c7915c..85c634f84a1c295329d6112b93de24ef0357bb8a 100644 (file)
@@ -3673,6 +3673,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
 #endif /* CONFIG_FILS */
        } else if (os_strcmp(buf, "multicast_to_unicast") == 0) {
                bss->multicast_to_unicast = atoi(pos);
+       } else if (os_strcmp(buf, "broadcast_deauth") == 0) {
+               bss->broadcast_deauth = atoi(pos);
        } else {
                wpa_printf(MSG_ERROR,
                           "Line %d: unknown configuration item '%s'",
index c4eebff82e1715e4fde28fc5b40abf117701900b..da975050db917f612f99efa161d10e0278414d01 100644 (file)
@@ -511,6 +511,10 @@ wmm_ac_vo_acm=0
 #
 #multicast_to_unicast=0
 
+# Send broadcast Deauthentication frame on AP start/stop
+# Default: 1 (enabled)
+#broadcast_deauth=1
+
 ##### IEEE 802.11n related configuration ######################################
 
 # ieee80211n: Whether IEEE 802.11n (HT) is enabled
index 9abcab7fb03b2d676f35fe9a7088b17e432feb75..a996ea81f42f7964a482b3a8493cefc9a5c6ec91 100644 (file)
@@ -107,6 +107,8 @@ void hostapd_config_defaults_bss(struct hostapd_bss_config *bss)
        bss->dhcp_server_port = DHCP_SERVER_PORT;
        bss->dhcp_relay_port = DHCP_SERVER_PORT;
 #endif /* CONFIG_FILS */
+
+       bss->broadcast_deauth = 1;
 }
 
 
index fdd5a1abccd645964f7317849ab5b6e064ac3f76..cbdb786f55e1cc226976c4c009ef9030a31f810a 100644 (file)
@@ -617,6 +617,8 @@ struct hostapd_bss_config {
 #endif /* CONFIG_FILS */
 
        int multicast_to_unicast;
+
+       int broadcast_deauth;
 };
 
 /**
index d05dc5c2417c83e2b89db54c190b64bfdc480922..4ae7520b210c56616a968f827a25671c5040887d 100644 (file)
@@ -491,9 +491,12 @@ static int hostapd_flush_old_stations(struct hostapd_data *hapd, u16 reason)
                        ret = -1;
                }
        }
-       wpa_dbg(hapd->msg_ctx, MSG_DEBUG, "Deauthenticate all stations");
-       os_memset(addr, 0xff, ETH_ALEN);
-       hostapd_drv_sta_deauth(hapd, addr, reason);
+       if (hapd->conf && hapd->conf->broadcast_deauth) {
+               wpa_dbg(hapd->msg_ctx, MSG_DEBUG,
+                       "Deauthenticate all stations");
+               os_memset(addr, 0xff, ETH_ALEN);
+               hostapd_drv_sta_deauth(hapd, addr, reason);
+       }
        hostapd_free_stas(hapd);
 
        return ret;