From: Otto Moerbeek Date: Wed, 7 Dec 2022 13:09:56 +0000 (+0100) Subject: Only raise the limit to 1M if the current is lower than 1M X-Git-Tag: dnsdist-1.8.0-rc1~180^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F11554%2Fhead;p=thirdparty%2Fpdns.git Only raise the limit to 1M if the current is lower than 1M --- diff --git a/pdns/bpf-filter.cc b/pdns/bpf-filter.cc index 435c0f16f7..bb0c58e01d 100644 --- a/pdns/bpf-filter.cc +++ b/pdns/bpf-filter.cc @@ -361,11 +361,10 @@ BPFFilter::BPFFilter(std::unordered_map& configs, throw std::runtime_error("Unable to get memory lock limit: " + stringerror()); } - const rlim_t minimal_limit_size = 64 * 124; const rlim_t new_limit_size = 1024 * 1024; - /* Check if the current soft memlock limit is at least minimal_limit */ - if (old_limit.rlim_cur < minimal_limit_size) { + /* Check if the current soft memlock limit is at least the limit */ + if (old_limit.rlim_cur < new_limit_size) { infolog("The current limit of locked memory (soft: %d, hard: %d) is too low for eBPF, trying to raise it to %d", old_limit.rlim_cur, old_limit.rlim_max, new_limit_size); struct rlimit new_limit;