iwinfo: fix get_bandwidth_iwinfo

Bug that was preventing kicking working due to mishandling of bandwidth
discovery. Fixed bug in use of get_bandwidth_iwinfo() in AP kicking.
Fix rounding of transmission rate calculations in
get_bandwidth_iwinfo().
Restructure of get_bandwidth...() while finding bug.

Signed-off-by: Ian Clowes <clowes_ian@hotmail.com>
This commit is contained in:
Ian Clowes 2022-01-06 09:16:18 +01:00 committed by Nick Hainke
parent 57be352a6a
commit 47c1e7a18b
2 changed files with 26 additions and 29 deletions

View file

@ -721,7 +721,7 @@ int kick_clients(ap* kicking_ap, uint32_t id) {
dawnlog_debug("Check if client is active receiving!\n");
float rx_rate, tx_rate;
bool have_bandwidth_iwinfo = !(get_bandwidth_iwinfo(j->client_addr, &rx_rate, &tx_rate));
bool have_bandwidth_iwinfo = get_bandwidth_iwinfo(j->client_addr, &rx_rate, &tx_rate);
if (!have_bandwidth_iwinfo && dawn_metric.bandwidth_threshold > 0) {
dawnlog_debug("No active transmission data for client. Don't kick!\n");
}