From c639249e4a4744f42b3e6a1884814804f84f28c4 Mon Sep 17 00:00:00 2001 From: Carsten Schuette Date: Fri, 8 Sep 2023 18:58:44 +0200 Subject: [PATCH] Do not kick clients depending on bandwidth when bandwidth_threshold is set to 0 --- src/storage/datastorage.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/storage/datastorage.c b/src/storage/datastorage.c index 7e6da46..951f3d8 100644 --- a/src/storage/datastorage.c +++ b/src/storage/datastorage.c @@ -562,15 +562,17 @@ int kick_clients(struct dawn_mac bssid_mac, uint32_t id) { } else { + if (dawn_metric.bandwidth_threshold != 0) + { // only use rx_rate for indicating if transmission is going on // <= 6MBits <- probably no transmission // tx_rate has always some weird value so don't use ist - if (have_bandwidth_iwinfo && dawn_metric.bandwidth_threshold != 0 && rx_rate > dawn_metric.bandwidth_threshold) { + if (have_bandwidth_iwinfo && rx_rate > dawn_metric.bandwidth_threshold) { dawnlog_info("Client " MACSTR ": Don't kick due to active data transfer: RX rate %f exceeds %d limit\n", MAC2STR(j->client_addr.u8), rx_rate, dawn_metric.bandwidth_threshold); } else { - if (have_bandwidth_iwinfo && dawn_metric.bandwidth_threshold != 0) + if (have_bandwidth_iwinfo) dawnlog_always("Client " MACSTR ": Kicking due to low active data transfer: RX rate %f below %d limit\n", MAC2STR(j->client_addr.u8), rx_rate, dawn_metric.bandwidth_threshold); else dawnlog_always("Client " MACSTR ": Kicking as no active transmission data for client, and / or limit of %d is OK.\n", @@ -612,6 +614,7 @@ int kick_clients(struct dawn_mac bssid_mac, uint32_t id) { kicked_clients++; } + } } } }