summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2016-12-27 15:28:24 +0545
committerRenato Botelho <renato@netgate.com>2016-12-27 10:41:54 -0200
commit29069aed151657c98990bfd474287094ac55749c (patch)
tree8e2843cb1d60c295027892535e7e733bb15ec95c /src
parent9080e20d6c908d03ffa7dab30565603d46fe3134 (diff)
downloadpfsense-29069aed151657c98990bfd474287094ac55749c.zip
pfsense-29069aed151657c98990bfd474287094ac55749c.tar.gz
Fix DNS Server Gateway Check
If I enter a DNS server IP address that is on a locally connected network, and choose a gateway for it, this code was supposed to give an error message. But no error was given because $_POST[$dnsgwitem] is actually the name of the gateway, but old line 197 called interface_has_gateway() which was expecting an interface to be passed. Just get rid of the interface_has_gateway() test, and come into this foreach() whenever the users chooses a gateway that is not "none". (cherry picked from commit d858795251b3eb2190cc16adaec13a4efee9955b)
Diffstat (limited to 'src')
-rw-r--r--src/usr/local/www/system.php10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/usr/local/www/system.php b/src/usr/local/www/system.php
index 86d237a..c44851f 100644
--- a/src/usr/local/www/system.php
+++ b/src/usr/local/www/system.php
@@ -225,12 +225,10 @@ if ($_POST) {
for ($dnscounter=1; $dnscounter<5; $dnscounter++) {
$dnsitem = "dns{$dnscounter}";
$dnsgwitem = "dns{$dnscounter}gw";
- if ($_POST[$dnsgwitem]) {
- if (interface_has_gateway($_POST[$dnsgwitem])) {
- foreach ($direct_networks_list as $direct_network) {
- if (ip_in_subnet($_POST[$dnsitem], $direct_network)) {
- $input_errors[] = sprintf(gettext("A gateway can not be assigned to DNS '%s' server which is on a directly connected network."), $_POST[$dnsitem]);
- }
+ if ($_POST[$dnsgwitem] && ($_POST[$dnsgwitem] <> "none")) {
+ foreach ($direct_networks_list as $direct_network) {
+ if (ip_in_subnet($_POST[$dnsitem], $direct_network)) {
+ $input_errors[] = sprintf(gettext("A gateway can not be assigned to DNS '%s' server which is on a directly connected network."), $_POST[$dnsitem]);
}
}
}
OpenPOWER on IntegriCloud