aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/ratelimiter.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-01-06 11:49:06 -0500
committerJason A. Donenfeld <Jason@zx2c4.com>2019-01-23 14:29:44 +0100
commit8c8de14b703e11331646b041ca5868bdac448122 (patch)
tree0d4bbd405c9cf1c98f65233c53b5e35dc1a5dfc4 /src/ratelimiter.c
parentnoise: replace getnstimeofday64 with ktime_get_real_ts64 (diff)
downloadwireguard-monolithic-historical-8c8de14b703e11331646b041ca5868bdac448122.tar.xz
wireguard-monolithic-historical-8c8de14b703e11331646b041ca5868bdac448122.zip
ratelimiter: totalram_pages is now a function
Reported-by: Alex Xu <alex@alxu.ca>
Diffstat (limited to '')
-rw-r--r--src/ratelimiter.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ratelimiter.c b/src/ratelimiter.c
index 82d1379..b3b1d25 100644
--- a/src/ratelimiter.c
+++ b/src/ratelimiter.c
@@ -170,9 +170,9 @@ int wg_ratelimiter_init(void)
* we borrow their wisdom about good table sizes on different systems
* dependent on RAM. This calculation here comes from there.
*/
- table_size = (totalram_pages > (1U << 30) / PAGE_SIZE) ? 8192 :
+ table_size = (totalram_pages() > (1U << 30) / PAGE_SIZE) ? 8192 :
max_t(unsigned long, 16, roundup_pow_of_two(
- (totalram_pages << PAGE_SHIFT) /
+ (totalram_pages() << PAGE_SHIFT) /
(1U << 14) / sizeof(struct hlist_head)));
max_entries = table_size * 8;