Commit 89bd6828 authored by Franco Fichtner's avatar Franco Fichtner

dns filter: adaptive IP protocol preference; refs #434

Also fix a race between includes: util.inc should come first.
parent 3063ced6
......@@ -27,8 +27,9 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
require_once("config.inc");
require_once("util.inc");
require_once("config.inc");
/* THIS MUST BE ABOVE ALL OTHER CODE */
if (empty($nocsrf)) {
......
......@@ -79,10 +79,23 @@ if ($_POST) {
if ($refresh) {
if ($config['opendns']['enable']) {
unset($config['system']['dnsserver']);
$config['system']['dnsserver'][] = '208.67.222.222';
$config['system']['dnsserver'][] = '208.67.220.220';
$config['system']['dnsserver'][] = '2620:0:ccc::2';
$config['system']['dnsserver'][] = '2620:0:ccd::2';
$v4_server = array('208.67.222.222', '208.67.220.220');
$v6_server = array('2620:0:ccc::2', '2620:0:ccd::2');
if (isset($config['system']['prefer_ipv4'])) {
$config['system']['dnsserver'][] = $v4_server[0];
$config['system']['dnsserver'][] = $v4_server[1];
if (isset($config['system']['ipv6allow'])) {
$config['system']['dnsserver'][] = $v6_server[0];
$config['system']['dnsserver'][] = $v6_server[1];
}
} else {
if (isset($config['system']['ipv6allow'])) {
$config['system']['dnsserver'][] = $v6_server[0];
$config['system']['dnsserver'][] = $v6_server[1];
}
$config['system']['dnsserver'][] = $v4_server[0];
$config['system']['dnsserver'][] = $v4_server[1];
}
$config['system']['dnsallowoverride'] = false;
} else {
unset($config['system']['dnsserver']);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment