]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Testing functionality for airtime policy
authorJouni Malinen <j@w1.fi>
Sat, 20 Mar 2021 10:02:18 +0000 (12:02 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 20 Mar 2021 10:03:01 +0000 (12:03 +0200)
Add a new testing parameter to allow airtime policy implementation to be
tested for more coverage even without kernel driver support.

Signed-off-by: Jouni Malinen <j@w1.fi>
hostapd/ctrl_iface.c
src/ap/airtime_policy.c
src/ap/hostapd.h

index 62fa51e91c20aed39c1580380d70420fba4a81bc..a906637e081526e4cf09e7036c33f3e0e4f2ee45 100644 (file)
@@ -1469,6 +1469,8 @@ static int hostapd_ctrl_iface_set(struct hostapd_data *hapd, char *cmd)
                hapd->ext_mgmt_frame_handling = atoi(value);
        } else if (os_strcasecmp(cmd, "ext_eapol_frame_io") == 0) {
                hapd->ext_eapol_frame_io = atoi(value);
+       } else if (os_strcasecmp(cmd, "force_backlog_bytes") == 0) {
+               hapd->force_backlog_bytes = atoi(value);
 #ifdef CONFIG_DPP
        } else if (os_strcasecmp(cmd, "dpp_config_obj_override") == 0) {
                os_free(hapd->dpp_config_obj_override);
index 1e67f0d5996e0ef7b788a3a30e29ac5581556a75..abe817c5b01585c052f0949414ed6fde933ea131 100644 (file)
@@ -79,6 +79,10 @@ static void count_backlogged_sta(struct hostapd_data *hapd)
        for (sta = hapd->sta_list; sta; sta = sta->next) {
                if (hostapd_drv_read_sta_data(hapd, &data, sta->addr))
                        continue;
+#ifdef CONFIG_TESTING_OPTIONS
+               if (hapd->force_backlog_bytes)
+                       data.backlog_bytes = 1;
+#endif /* CONFIG_TESTING_OPTIONS */
 
                if (data.backlog_bytes > 0)
                        set_new_backlog_time(hapd, sta, &now);
index 44f566a4240366bf1cec123633fcf05d4d463187..07d0aaa9210078fc704ad66bbfd0569b0aa6b7df 100644 (file)
@@ -354,6 +354,8 @@ struct hostapd_data {
        int last_bigtk_key_idx;
        u8 last_bigtk[WPA_BIGTK_MAX_LEN];
        size_t last_bigtk_len;
+
+       bool force_backlog_bytes;
 #endif /* CONFIG_TESTING_OPTIONS */
 
 #ifdef CONFIG_MBO