diff options
author | Warren Baker <warren@decoy.co.za> | 2013-10-06 21:39:13 +0200 |
---|---|---|
committer | Warren Baker <warren@decoy.co.za> | 2013-10-06 21:39:13 +0200 |
commit | 4dfc14961006b0702d1c5e18190b3fcd64dd4d76 (patch) | |
tree | 0e92df3898373f0ac065ce1710359963f20fa6e3 /config/unbound/unbound.inc | |
parent | 9d9b450db407986c9811a776696ed23bd8fdef28 (diff) | |
download | pfsense-packages-4dfc14961006b0702d1c5e18190b3fcd64dd4d76.tar.gz pfsense-packages-4dfc14961006b0702d1c5e18190b3fcd64dd4d76.tar.bz2 pfsense-packages-4dfc14961006b0702d1c5e18190b3fcd64dd4d76.zip |
Make sure send and receive buffers actually do get set
Diffstat (limited to 'config/unbound/unbound.inc')
-rw-r--r-- | config/unbound/unbound.inc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/config/unbound/unbound.inc b/config/unbound/unbound.inc index c3de2f88..9c38fa2e 100644 --- a/config/unbound/unbound.inc +++ b/config/unbound/unbound.inc @@ -546,6 +546,7 @@ harden-dnssec-stripped: {$harden_dnssec_stripped} {$optimization['rrset_cache_size']} outgoing-range: 8192 {$optimization['so_rcvbuf']} +{$optimization['so_sndbuf']} # Interface IP(s) to bind to {$unbound_bind_interfaces} @@ -648,20 +649,21 @@ function unbound_optimization() { // Check that it is set to 4MB (by default the OS has it configured to 4MB) foreach ($config['sysctl']['item'] as $tunable) { if ($tunable['tunable'] == 'kern.ipc.maxsockbuf') { - $so = floor(($tunable['value']/1024/1024)-1); + if ($tunable['value'] == 'default') + $maxsockbuf = '4262144'; + else + $maxsockbuf = $tunable['value']; + $so = floor(($maxsockbuf/1024/1024)-1); // Check to ensure that the number is not a negative if ($so > 0) { $optimization['so_rcvbuf'] = "so-rcvbuf: {$so}m"; $optimization['so_sndbuf'] = "so-sndbuf: {$so}m"; } else { - unset($optimization['so_rcvbuf']); - unset($optimization['so_sndbuf']); + $optimization['so_rcvbuf'] = "#so-rcvbuf: 4m"; + $optimization['so_sndbuf'] = "#so-sndbuf: 4m"; } } } - // Safety check in case kern.ipc.maxsockbuf is deleted. - if(!isset($optimization['so_rcvbuf'])) - $optimization['so_rcvbuf'] = "#so-rcvbuf: 4m"; return $optimization; } |