diff options
-rw-r--r-- | etc/inc/filter.inc | 6 | ||||
-rw-r--r-- | usr/local/www/system_advanced_firewall.php | 21 |
2 files changed, 26 insertions, 1 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 0b46c2c..7635cc8 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -343,7 +343,11 @@ function filter_configure_sync($delete_states_if_needed = true) { * FilterDNS has three debugging levels. The default choosen is 1. * Availabe are level 2 and greater then 2. */ - mwexec("/usr/local/sbin/filterdns -p {$g['varrun_path']}/filterdns.pid -i 300 -c {$g['varetc_path']}/filterdns.conf -d 1"); + if (isset($config['system']['aliasesresolveinterval']) && is_numeric($config['system']['aliasesresolveinterval'])) + $resolve_interval = $config['system']['aliasesresolveinterval']; + else + $resolve_interval = 300; + mwexec("/usr/local/sbin/filterdns -p {$g['varrun_path']}/filterdns.pid -i {$resolve_interval} -c {$g['varetc_path']}/filterdns.conf -d 1"); } } else { killbypid("{$g['varrun_path']}/filterdns.pid"); diff --git a/usr/local/www/system_advanced_firewall.php b/usr/local/www/system_advanced_firewall.php index 1872096..f4ea44a 100644 --- a/usr/local/www/system_advanced_firewall.php +++ b/usr/local/www/system_advanced_firewall.php @@ -57,6 +57,8 @@ $pconfig['optimization'] = $config['filter']['optimization']; $pconfig['adaptivestart'] = $config['system']['adaptivestart']; $pconfig['adaptiveend'] = $config['system']['adaptiveend']; $pconfig['maximumstates'] = $config['system']['maximumstates']; +$pconfig['aliasesresolveinterval'] = $config['system']['aliasesresolveinterval']; +$old_aliasesresolveinterval = $config['system']['aliasesresolveinterval']; $pconfig['maximumtables'] = $config['system']['maximumtables']; $pconfig['maximumtableentries'] = $config['system']['maximumtableentries']; $pconfig['disablereplyto'] = isset($config['system']['disablereplyto']); @@ -87,6 +89,9 @@ if ($_POST) { if ($_POST['maximumstates'] && !is_numericint($_POST['maximumstates'])) { $input_errors[] = gettext("The Firewall Maximum States value must be an integer."); } + if ($_POST['aliasesresolveinterval'] && !is_numericint($_POST['aliasesresolveinterval'])) { + $input_errors[] = gettext("The Aliases Hostname Resolve Interval value must be an integer."); + } if ($_POST['maximumtables'] && !is_numericint($_POST['maximumtables'])) { $input_errors[] = gettext("The Firewall Maximum Tables value must be an integer."); } @@ -140,6 +145,7 @@ if ($_POST) { $config['system']['optimization'] = $_POST['optimization']; $config['system']['maximumstates'] = $_POST['maximumstates']; + $config['system']['aliasesresolveinterval'] = $_POST['aliasesresolveinterval']; $config['system']['maximumtables'] = $_POST['maximumtables']; $config['system']['maximumtableentries'] = $_POST['maximumtableentries']; @@ -209,6 +215,11 @@ if ($_POST) { write_config(); + // Kill filterdns when value changes, filter_configure() will restart it + if (($old_aliasesresolveinterval != $config['system']['aliasesresolveinterval']) && + isvalidpid("{$g['varrun_path']}/filterdns.pid")) + killbypid("{$g['varrun_path']}/filterdns.pid"); + $retval = 0; $retval = filter_configure(); if(stristr($retval, "error") <> true) @@ -442,6 +453,16 @@ function update_description(itemnum) { </td> </tr> <tr> + <td width="22%" valign="top" class="vncell"><?=gettext("Aliases Hostnames Resolve Interval");?></td> + <td width="78%" class="vtable"> + <input name="aliasesresolveinterval" type="text" id="aliasesresolveinterval" value="<?php echo $pconfig['aliasesresolveinterval']; ?>" /> + <br/> + <strong><?=gettext("Interval, in seconds, that will be used to resolve hostnames configured on aliases.");?></strong> + <br/> + <span class="vexpl"><?=gettext("Note: Leave this blank for the default (300s).");?></span> + </td> + </tr> + <tr> <td colspan="2" class="list" height="12"> </td> </tr> <tr> |