Project

General

Profile

« Previous | Next » 

Revision 4708c6f0

Added by Phil Davis over 10 years ago

Limit unbound so-rcvbuf: 8m

Issue reported here: https://forum.pfsense.org/index.php?topic=78356.msg472781#msg472781
Most unbound doc places mention setting it at up to 8m. I'm sure it would be possible to investigate more and find a way to make unbound+FreeBSD be able to go higher than 8m. But probably 8m is sufficient for everyone anyway (judging by what the unbound docs seem to assume will be a good value on a busy system).
Anyway, here is my easy fix for this. Someone else feel free to investigate more if they really need to set so-rcvbuf higher.

View differences:

etc/inc/unbound.inc
97 97
			if ($tunable['tunable'] == 'kern.ipc.maxsockbuf') {
98 98
				$so = floor(($tunable['value']/1024/1024)-1);
99 99
				// Check to ensure that the number is not a negative
100
				if ($so > 0)
100
				if ($so > 0) {
101
					// Limit to 8MB, users might set maxsockbuf very high for other reasons.
102
					// We do not want unbound to fail because of that.
103
					$so = min($so, 8);
101 104
					$optimization['so_rcvbuf'] = "so-rcvbuf: {$so}m";
105
				}
102 106
				else
103 107
					unset($optimization['so_rcvbuf']);
104 108
			}

Also available in: Unified diff