Commit 74e04d29 authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

(resolver+forwarder) enhance port check, for https://github.com/opnsense/core/issues/1213

(cherry picked from commit d9387089)
parent bae7adb3
......@@ -70,7 +70,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if (!empty($pconfig['port']) && !is_port($pconfig['port'])) {
$input_errors[] = gettext("You must specify a valid port number");
}
if (!empty($pconfig['enable']) && isset($config['unbound']['enable']) && (empty($config['unbound']['port']) || $config['unbound']['port'] == '53')) {
$unbound_port = empty($config['unbound']['port']) ? "53" : $config['unbound']['port'];
$dnsmasq_port = empty($pconfig['port']) ? "53" : $pconfig['port'];
if (!empty($pconfig['enable']) && isset($config['unbound']['enable']) && $dnsmasq_port == $unbound_port) {
$input_errors[] = gettext("The DNS Resolver is still active. Disable it before enabling the DNS Forwarder.");
}
......
......@@ -67,7 +67,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
exit;
} else {
// perform validations
if (isset($pconfig['enable']) && isset($config['dnsmasq']['enable']) && (empty($pconfig['port']) || $pconfig['port'] == '53')) {
$unbound_port = empty($pconfig['port']) ? "53" : $pconfig['port'];
$dnsmasq_port = empty($config['dnsmasq']['port']) ? "53" : $config['dnsmasq']['port'];
if (isset($pconfig['enable']) && isset($config['dnsmasq']['enable']) && $unbound_port == $dnsmasq_port) {
$input_errors[] = gettext("The DNS Forwarder is still active. Disable it before enabling the DNS Resolver.");
}
if (!empty($pconfig['regdhcpdomain']) && !is_domain($pconfig['regdhcpdomain'])) {
......
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