summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2009-07-12 14:18:39 -0400
committerScott Ullrich <sullrich@pfsense.org>2009-07-12 14:18:39 -0400
commit79c2e54a8c5a411947687ac40bb691d91c44a85a (patch)
treea728ff73b89e2884c4e162aecb408651ab746a34 /etc
parente630feeeff5586f5e6d07fd20ada0efcf64f3a53 (diff)
downloadpfsense-79c2e54a8c5a411947687ac40bb691d91c44a85a.zip
pfsense-79c2e54a8c5a411947687ac40bb691d91c44a85a.tar.gz
Oops, we do not need to reboot to set nmbflows
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/filter.inc14
1 files changed, 4 insertions, 10 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 31570d0..eaaa851 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -58,16 +58,8 @@ function flowtable_configure() {
else
$maxstates = "150000";
// nmbflows cpu count * ($maxstates * 2)
- $cpus = trim(`sysctl kern.smp.cpus | cut -d' ' -f2`);
+ $cpus = trim(`/usr/sbin/sysctl kern.smp.cpus | /usr/bin/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 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", $loader_conf);
- }
// Is flowtable enabled?
if($config['system']['flowtable'])
$flowtable_enable = 1;
@@ -75,8 +67,10 @@ function flowtable_configure() {
$flowtable_enable = 0;
// Flowtable currently only works on 8.0
if(get_freebsd_version() == "8") {
- if($flowtable_enable == 1)
+ if($flowtable_enable == 1) {
mwexec("/usr/sbin/sysctl net.inet.flowtable.nmbflows={$config['system']['maximumstates']}");
+ mwexec("/usr/sbin/sysctl net.inet.ip.output_flowtable_size={$nmbflows}");
+ }
mwexec("/usr/sbin/sysctl net.inet.flowtable.emable={$flowtable_enable}");
}
}
OpenPOWER on IntegriCloud