diff options
author | Warren Baker <warren@decoy.co.za> | 2015-01-09 10:23:54 +0200 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2015-01-12 16:32:07 -0600 |
commit | ad9148aefaa71bfda268780845b6d75d6f7d8d23 (patch) | |
tree | 8a314ccd079fa4f62e700f9265864b42927f479d | |
parent | bdb8fbffb0ce409b428c4bb6fd38987cfd656336 (diff) | |
download | pfsense-ad9148aefaa71bfda268780845b6d75d6f7d8d23.zip pfsense-ad9148aefaa71bfda268780845b6d75d6f7d8d23.tar.gz |
Allow for overhead and up maximum limit from 8 to 32, also only set it if its set to 4 or above. Fixes https://forum.pfsense.org/index.php?topic=78356.msg472781#msg472781
-rw-r--r-- | etc/inc/unbound.inc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/etc/inc/unbound.inc b/etc/inc/unbound.inc index 6ed6351..9fe32e4 100644 --- a/etc/inc/unbound.inc +++ b/etc/inc/unbound.inc @@ -95,16 +95,16 @@ function unbound_optimization() { if (is_array($config['sysctl']) && is_array($config['sysctl']['item'])) { foreach ($config['sysctl']['item'] as $tunable) { if ($tunable['tunable'] == 'kern.ipc.maxsockbuf') { - $so = floor(($tunable['value']/1024/1024)-1); + $so = floor(($tunable['value']/1024/1024)-4); // Check to ensure that the number is not a negative - if ($so > 0) { - // Limit to 8MB, users might set maxsockbuf very high for other reasons. + if ($so >= 4) { + // Limit to 32MB, users might set maxsockbuf very high for other reasons. // We do not want unbound to fail because of that. - $so = min($so, 8); + $so = min($so, 32); $optimization['so_rcvbuf'] = "so-rcvbuf: {$so}m"; - } - else + } else { unset($optimization['so_rcvbuf']); + } } } } @@ -682,4 +682,4 @@ function unbound_hosts_generate() { unbound_control("reload"); } -?> +?>
\ No newline at end of file |