diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2009-07-12 14:04:09 -0400 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2009-07-12 14:04:09 -0400 |
commit | 839fdfaff5b8e28d7c068373708c131641a25022 (patch) | |
tree | 2e392a04c397f6c1edd9c6819647d07001cb7fde | |
parent | 7982f851e1c8d3183aca94b44e5172474efeaf47 (diff) | |
download | pfsense-839fdfaff5b8e28d7c068373708c131641a25022.zip pfsense-839fdfaff5b8e28d7c068373708c131641a25022.tar.gz |
Grab # cpus correctly and correct the grep for flowtable_size
-rw-r--r-- | etc/inc/filter.inc | 8 |
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']) |