diff options
author | Phil Davis <phil.davis@inf.org> | 2016-12-27 15:28:24 +0545 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-27 15:28:24 +0545 |
commit | d858795251b3eb2190cc16adaec13a4efee9955b (patch) | |
tree | 90b6b52d324c072a2b3ed14933df98579879111f /src | |
parent | c01bdca9ba2ddfed14285ff36e1f6508c4452717 (diff) | |
download | pfsense-d858795251b3eb2190cc16adaec13a4efee9955b.zip pfsense-d858795251b3eb2190cc16adaec13a4efee9955b.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".
Diffstat (limited to 'src')
-rw-r--r-- | src/usr/local/www/system.php | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/usr/local/www/system.php b/src/usr/local/www/system.php index b588256..83ab5e7 100644 --- a/src/usr/local/www/system.php +++ b/src/usr/local/www/system.php @@ -193,12 +193,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]); } } } |