From 8933e787f50a0c99bc4e11303d89ba16607c5031 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 29 Apr 2020 10:03:31 +0200 Subject: [PATCH] system: set value on the fly, remove nonexistent tunable --- src/etc/config.xml.sample | 5 ----- src/etc/inc/system.inc | 10 ++++++++-- src/etc/inc/util.inc | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/etc/config.xml.sample b/src/etc/config.xml.sample index 25a7be89d..673ea2e0a 100644 --- a/src/etc/config.xml.sample +++ b/src/etc/config.xml.sample @@ -3,11 +3,6 @@ opnsense - - - debug.pfftpproxy - default - vfs.read_max diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc index 04ad7ad86..0b36f8504 100644 --- a/src/etc/inc/system.inc +++ b/src/etc/inc/system.inc @@ -73,7 +73,6 @@ function system_powerd_configure($verbose = false) function get_default_sysctl_value($id) { $sysctls = array( - 'debug.pfftpproxy' => '0', 'hw.ibrs_disable' => '0', 'hw.syscons.kbd_reboot' => '0', 'kern.ipc.maxsockbuf' => '4262144', @@ -111,13 +110,20 @@ function get_default_sysctl_value($id) 'net.link.bridge.pfil_onlyip' => '0', 'net.link.tap.user_open' => '1', 'net.local.dgram.maxdgram' => '8192', - 'net.pf.request_maxcount' => '5000000', + 'net.pf.request_maxcount' => '65535', 'security.bsd.see_other_gids' => '0', 'security.bsd.see_other_uids' => '0', 'vfs.read_max' => '32', 'vm.pmap.pti' => '1', ); + if ($id == 'net.pf.request_maxcount') { + $system = config_read_array('system'); + if (!empty($system['maximumtableentries'])) { + $sysctls[$id] = $system['maximumtableentries']; + } + } + if (isset($sysctls[$id])) { return $sysctls[$id]; } diff --git a/src/etc/inc/util.inc b/src/etc/inc/util.inc index cd8c86cbf..92183e796 100644 --- a/src/etc/inc/util.inc +++ b/src/etc/inc/util.inc @@ -1306,8 +1306,8 @@ function set_sysctl($values) $value_list = array(); foreach ($values as $key => $value) { if ($sysctls != null && !in_array($key, $sysctls)) { - continue; - } + continue; + } $value_list[] = escapeshellarg($key) . "=" . escapeshellarg($value); }