From 839fdfaff5b8e28d7c068373708c131641a25022 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 12 Jul 2009 14:04:09 -0400 Subject: Grab # cpus correctly and correct the grep for flowtable_size --- etc/inc/filter.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'etc') 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']) -- cgit v1.1