summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2009-07-12 14:04:09 -0400
committerScott Ullrich <sullrich@pfsense.org>2009-07-12 14:04:09 -0400
commit839fdfaff5b8e28d7c068373708c131641a25022 (patch)
tree2e392a04c397f6c1edd9c6819647d07001cb7fde /etc/inc
parent7982f851e1c8d3183aca94b44e5172474efeaf47 (diff)
downloadpfsense-839fdfaff5b8e28d7c068373708c131641a25022.zip
pfsense-839fdfaff5b8e28d7c068373708c131641a25022.tar.gz
Grab # cpus correctly and correct the grep for flowtable_size
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/filter.inc8
1 files changed, 4 insertions, 4 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 4b5643d..31570d0 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -58,15 +58,15 @@ function flowtable_configure() {
else
$maxstates = "150000";
// nmbflows cpu count * ($maxstates * 2)
- $cpus = trim(`sysctl kern.smp.cpus`);
- $nmbflows = $cpus*($maxstates*2);
+ $cpus = trim(`sysctl kern.smp.cpus | cut -d' ' -f2`);
+ $nmbflows = ($cpus*($maxstates*2));
if(!file_exists("/boot/loader.conf"))
touch("/boot/loader.conf");
- $loader_conf_nmbflows = trim(`cat /boot/loader_conf | grep nmbflows | cut -d'=' -f2`);
+ $loader_conf_nmbflows = trim(`cat /boot/loader.conf | grep flowtable_size | cut -d'=' -f2`);
if($loader_conf_nmbflows <> $nmbflows) {
$loader_conf = trim(`cat /boot/loader_conf | grep -v nmbflows`);
$loader_conf .= "\nnet.inet.ip.output_flowtable_size={$nmbflows}\n";
- file_put_contents("/boot/loader.conf", trim($loader_conf));
+ file_put_contents("/boot/loader.conf", $loader_conf);
}
// Is flowtable enabled?
if($config['system']['flowtable'])
OpenPOWER on IntegriCloud