]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Only raise the limit to 1M if the current is lower than 1M 11554/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 7 Dec 2022 13:09:56 +0000 (14:09 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 7 Dec 2022 13:09:56 +0000 (14:09 +0100)
pdns/bpf-filter.cc

index 435c0f16f7f274a8b9f928ed8e78503113443b64..bb0c58e01d9c7f44fdf176afcc55d610277282d9 100644 (file)
@@ -361,11 +361,10 @@ BPFFilter::BPFFilter(std::unordered_map<std::string, MapConfiguration>& 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;