diff options
author | Scott Ullrich <sullrich@pfSense.org> | 2010-01-20 17:57:14 -0500 |
---|---|---|
committer | Scott Ullrich <sullrich@pfSense.org> | 2010-01-20 17:57:14 -0500 |
commit | 3a35f55f3c429d9da0699f4f35fa83f2a0a2dc4d (patch) | |
tree | eaa4288a83e5438432726740087d119faabbf4d2 /etc | |
parent | cac19f50aca6ae61766592c3198d2f8287a420ac (diff) | |
download | pfsense-3a35f55f3c429d9da0699f4f35fa83f2a0a2dc4d.zip pfsense-3a35f55f3c429d9da0699f4f35fa83f2a0a2dc4d.tar.gz |
Stop fighting php bugs where a variable is not defined on one system yet it is defined on another.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/globals.inc | 29 | ||||
-rw-r--r-- | etc/inc/sysctl.inc | 42 | ||||
-rw-r--r-- | etc/inc/system.inc | 11 |
3 files changed, 38 insertions, 44 deletions
diff --git a/etc/inc/globals.inc b/etc/inc/globals.inc index aae5972..2cd0e4b 100644 --- a/etc/inc/globals.inc +++ b/etc/inc/globals.inc @@ -141,4 +141,33 @@ if(file_exists("/etc/platform")) { } } +/* Default sysctls */ +$sysctls = array("net.inet.ip.portrange.first" => "1024", + "net.inet.tcp.blackhole" => "2", + "net.inet.udp.blackhole" => "1", + "net.inet.ip.random_id" => "1", + "net.inet.tcp.drop_synfin" => "1", + "net.inet.ip.redirect" => "1", + "net.inet6.ip6.redirect" => "1", + "net.inet.tcp.syncookies" => "1", + "net.inet.tcp.recvspace" => "65228", + "net.inet.tcp.sendspace" => "65228", + "net.inet.ip.fastforwarding" => "1", + "net.inet.tcp.delayed_ack" => "0", + "net.inet.udp.maxdgram" => "57344", + "net.link.bridge.pfil_onlyip" => "0", + "net.link.bridge.pfil_member" => "1", + "net.link.bridge.pfil_bridge" => "0", + "net.link.tap.user_open" => "1", + "kern.rndtest.verbose" => "0", + "kern.randompid" => "347", + "net.inet.ip.intr_queue_maxlen" => "1000", + "hw.syscons.kbd_reboot" => "0", + "net.inet.tcp.inflight.enable" => "1", + "net.inet.tcp.log_debug" => "0", + "net.inet.icmp.icmplim" => "750", + "net.inet.tcp.tso" => "0", + "hw.bce.tso_enable" => "0" + ); + ?>
\ No newline at end of file diff --git a/etc/inc/sysctl.inc b/etc/inc/sysctl.inc deleted file mode 100644 index 78c234a..0000000 --- a/etc/inc/sysctl.inc +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -$sysctls = array("net.inet.ip.portrange.first" => "1024", - "net.inet.tcp.blackhole" => "2", - "net.inet.udp.blackhole" => "1", - "net.inet.ip.random_id" => "1", - "net.inet.tcp.drop_synfin" => "1", - "net.inet.ip.redirect" => "1", - "net.inet6.ip6.redirect" => "1", - "net.inet.tcp.syncookies" => "1", - "net.inet.tcp.recvspace" => "65228", - "net.inet.tcp.sendspace" => "65228", - "net.inet.ip.fastforwarding" => "1", - "net.inet.tcp.delayed_ack" => "0", - "net.inet.udp.maxdgram" => "57344", - "net.link.bridge.pfil_onlyip" => "0", - "net.link.bridge.pfil_member" => "1", - "net.link.bridge.pfil_bridge" => "0", - "net.link.tap.user_open" => "1", - "kern.rndtest.verbose" => "0", - "kern.randompid" => "347", - "net.inet.ip.intr_queue_maxlen" => "1000", - "hw.syscons.kbd_reboot" => "0", - "net.inet.tcp.inflight.enable" => "1", - "net.inet.tcp.log_debug" => "0", - "net.inet.icmp.icmplim" => "750", - "net.inet.tcp.tso" => "0", - "hw.bce.tso_enable" => "0" - ); - -function get_default_sysctl_value($id) { - global $sysctls; - if(!is_array($sysctls)) - return; - foreach($sysctls as $sysctl => $value) { - if($sysctl == $id) - return $value; - } -} - - -?>
\ No newline at end of file diff --git a/etc/inc/system.inc b/etc/inc/system.inc index 5891829..9d60d26 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -48,15 +48,22 @@ function activate_powerd() { } } +function get_default_sysctl_value($id) { + global $sysctls; + foreach($sysctls as $sysctl => $value) { + if($sysctl == $id) + return $value; + } +} + function activate_sysctls() { global $config, $g; - require("sysctl.inc"); exec("/sbin/sysctl net.enc.out.ipsec_bpf_mask=0x00000001"); exec("/sbin/sysctl net.enc.out.ipsec_filter_mask=0x00000001"); exec("/sbin/sysctl net.enc.in.ipsec_bpf_mask=0x00000002"); exec("/sbin/sysctl net.enc.in.ipsec_filter_mask=0x00000002"); - if (is_array($config['sysctl'])) { + if(is_array($config['sysctl'])) { foreach($config['sysctl']['item'] as $tunable) { if($tunable['value'] == "default") { $value = get_default_sysctl_value($tunable['tunable']); |