diff options
author | stilez <stilezy@gmail.com> | 2013-05-11 12:59:35 +0200 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2013-05-15 17:34:46 -0400 |
commit | 683992fc993e7f9993772683691ddc909878e5bb (patch) | |
tree | 653cf148244d512a15283f0035e164ce311d0f8b /etc/inc/services.inc | |
parent | ebadf1802219f8f45b106cbba73976f56cf44917 (diff) | |
download | pfsense-683992fc993e7f9993772683691ddc909878e5bb.zip pfsense-683992fc993e7f9993772683691ddc909878e5bb.tar.gz |
dnsmasq conf won't allow some custom args
User can't specify or customise some dnsmasq args in custom_options (dns-forward-max, cache-size, etc) because they are hard coded in services_dnsmasq_configure().
Diffstat (limited to 'etc/inc/services.inc')
-rw-r--r-- | etc/inc/services.inc | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc index 1458e1c..c01ce04 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -1547,6 +1547,14 @@ function services_dnsmasq_configure() { global $config, $g; $return = 0; + // hard coded args: will be removed to avoid duplication if specified in custom_options + $standard_args = array( + "dns-forward-max" => "--dns-forward-max=5000", + "cache-size" => "--cache-size=10000", + "local-ttl" => "--local-ttl=1" + ); + + if(isset($config['system']['developerspew'])) { $mt = microtime(); echo "services_dnsmasq_configure() being called $mt\n"; @@ -1644,13 +1652,17 @@ function services_dnsmasq_configure() { $args .= " --domain-needed "; } - if ($config['dnsmasq']['custom_options']) { - foreach (preg_split('/\s+/', $config['dnsmasq']['custom_options']) as $c) + if ($config['dnsmasq']['custom_options']) + foreach (preg_split('/\s+/', $config['dnsmasq']['custom_options']) as $c) { $args .= " --$c"; - } + $p = explode('=', $c); + if (array_key_exists($p[0], $standard_args)) + unset($standard_args[$p[0]]); + } + $args .= implode(' ', array_values($standard_args)); /* run dnsmasq */ - $cmd = "/usr/local/sbin/dnsmasq --local-ttl 1 --all-servers {$dns_rebind} --dns-forward-max=5000 --cache-size=10000 {$args}"; + $cmd = "/usr/local/sbin/dnsmasq --all-servers {$dns_rebind} {$args}"; //log_error("dnsmasq command: {$cmd}"); mwexec_bg($cmd); unset($args); |