Fix - Typo making calculation of ul/dl rates incorrect.

Allowed rates were 4 times higher than configured.

Signed-off-by: Rob White <rob@blue-wave.net>
This commit is contained in:
Rob White
2021-08-12 19:17:06 +01:00
parent cc6737d6d2
commit b478cd682d

View File

@@ -888,7 +888,7 @@ iptables_download_ratelimit_enable(t_client *client, int enable)
int rc = 0;
unsigned long long int packets;
packets = (client->download_rate * 1000 / 1500) / 2;
packets = (client->download_rate * 1000 / 1500) / 8;
if (enable == 1) {
debug(LOG_INFO, "Download Rate Limiting [%s] [%s] to [%llu] packets per second", client->ip, client->mac, packets);
@@ -945,7 +945,7 @@ iptables_upload_ratelimit_enable(t_client *client, int enable)
int rc = 0;
unsigned long long int packets;
packets = (client->upload_rate * 1000 / 1500) / 2;
packets = (client->upload_rate * 1000 / 1500) / 8;
if (enable == 1) {
debug(LOG_INFO, "Upload Rate Limiting [%s] [%s] to [%llu] packets per second", client->ip, client->mac, packets);