summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlukehamburg <luke.hamburg@gmail.com>2016-02-26 23:31:01 -0500
committerlukehamburg <luke.hamburg@gmail.com>2016-02-26 23:31:01 -0500
commit815bbd40853c883944f6ab9b8bf5819e28888964 (patch)
tree1f68b23f5bad4d43e4ea4606a634d2cc9490906a
parenta069d03fe07e3ec6cfe6fabb235be53e99fecadd (diff)
downloadpfsense-815bbd40853c883944f6ab9b8bf5819e28888964.zip
pfsense-815bbd40853c883944f6ab9b8bf5819e28888964.tar.gz
Fix unbound.inc so zero value for *_num_tcp is honored
In the Unbound documentation, it is noted that setting "outgoing-num-tcp" to "0" disables TCP queries. In testing I noticed that although I could select & save a value of "0" in the Unbound Advanced Config, the actual value written to /var/unbound/unbound.conf was still the default "10". Apparently in PHP, a value of "0" still tests "false" for !empty(). Changing the test to isset() seems to fix the issue.
-rw-r--r--src/etc/inc/unbound.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/etc/inc/unbound.inc b/src/etc/inc/unbound.inc
index c716d1a..8a678a4 100644
--- a/src/etc/inc/unbound.inc
+++ b/src/etc/inc/unbound.inc
@@ -281,8 +281,8 @@ EOF;
$harden_dnssec_stripped = isset($unboundcfg['dnssecstripped']) ? "yes" : "no";
$prefetch = isset($unboundcfg['prefetch']) ? "yes" : "no";
$prefetch_key = isset($unboundcfg['prefetchkey']) ? "yes" : "no";
- $outgoing_num_tcp = (!empty($unboundcfg['outgoing_num_tcp'])) ? $unboundcfg['outgoing_num_tcp'] : "10";
- $incoming_num_tcp = (!empty($unboundcfg['incoming_num_tcp'])) ? $unboundcfg['incoming_num_tcp'] : "10";
+ $outgoing_num_tcp = isset($unboundcfg['outgoing_num_tcp']) ? $unboundcfg['outgoing_num_tcp'] : "10";
+ $incoming_num_tcp = isset($unboundcfg['incoming_num_tcp']) ? $unboundcfg['incoming_num_tcp'] : "10";
$edns_buffer_size = (!empty($unboundcfg['edns_buffer_size'])) ? $unboundcfg['edns_buffer_size'] : "4096";
$num_queries_per_thread = (!empty($unboundcfg['num_queries_per_thread'])) ? $unboundcfg['num_queries_per_thread'] : "4096";
$jostle_timeout = (!empty($unboundcfg['jostle_timeout'])) ? $unboundcfg['jostle_timeout'] : "200";
OpenPOWER on IntegriCloud