diff --git a/src/auth.c b/src/auth.c index d48bbdc..2459ea0 100644 --- a/src/auth.c +++ b/src/auth.c @@ -440,9 +440,14 @@ fw_refresh_client_list(void) uprate ); action = ENABLE; - iptables_download_ratelimit_enable(cp1, action); - //bit 0 is not set so toggle it to signify rate limiting is on - cp1->rate_exceeded = cp1->rate_exceeded^1; + + if (config->download_bucket_ratio > 0) { + iptables_download_ratelimit_enable(cp1, action); + //bit 0 is not set so toggle it to signify rate limiting is on + cp1->rate_exceeded = cp1->rate_exceeded^1; + } else { + debug(LOG_INFO, "Download RATE limiting is disabled"); + } } } @@ -484,9 +489,14 @@ fw_refresh_client_list(void) ); action = ENABLE; - iptables_upload_ratelimit_enable(cp1, action); - //bit 1 is not set so toggle it to signify rate limiting is on - cp1->rate_exceeded = cp1->rate_exceeded^2; + + if (config->upload_bucket_ratio > 0) { + iptables_upload_ratelimit_enable(cp1, action); + //bit 1 is not set so toggle it to signify rate limiting is on + cp1->rate_exceeded = cp1->rate_exceeded^2; + } else { + debug(LOG_INFO, "Upload RATE limiting is disabled"); + } } } diff --git a/src/main.c b/src/main.c index aca133a..5e41d9a 100644 --- a/src/main.c +++ b/src/main.c @@ -822,13 +822,13 @@ setup_from_config(void) // Check down/up bucket ratios rates are not less than minimum value of 1 if (config->download_bucket_ratio < 1) { - debug(LOG_WARNING, "Download bucket ratio setting of %llu is below the required minimum. Setting to 1.", config->download_bucket_ratio); - config->download_bucket_ratio = 1; + debug(LOG_WARNING, "Download bucket ratio setting of %llu disables rate limiting.", config->download_bucket_ratio); + config->download_bucket_ratio = 0; } if (config->upload_bucket_ratio < 1) { - debug(LOG_WARNING, "Upload bucket ratio setting of %llu is below the required minimum. Setting to 1.", config->upload_bucket_ratio); - config->upload_bucket_ratio = 1; + debug(LOG_WARNING, "Upload bucket ratio setting of %llu disables rate limiting.", config->upload_bucket_ratio); + config->upload_bucket_ratio = 0; }