mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Don't allow an IP to be configured multiple times as a DNS server. Ticket #5915
This commit is contained in:
parent
830ea39af8
commit
f700dc99fd
@ -180,6 +180,7 @@ if ($_POST) {
|
||||
for ($dnscounter=1; $dnscounter<5; $dnscounter++) {
|
||||
$dnsname="dns{$dnscounter}";
|
||||
$dnsgwname="dns{$dnscounter}gw";
|
||||
$dnslist[] = $_POST[$dnsname];
|
||||
if (($_POST[$dnsname] && !is_ipaddr($_POST[$dnsname]))) {
|
||||
$input_errors[] = sprintf(gettext("A valid IP address must be specified for DNS server %s."), $dnscounter);
|
||||
} else {
|
||||
@ -200,6 +201,10 @@ if ($_POST) {
|
||||
}
|
||||
}
|
||||
|
||||
if (count($dnslist) != count(array_unique($dnslist))) {
|
||||
$input_errors[] = gettext('Each configured DNS server must have a unique IP address. Remove the duplicated IP.');
|
||||
}
|
||||
|
||||
$direct_networks_list = explode(" ", filter_get_direct_networks_list());
|
||||
for ($dnscounter=1; $dnscounter<5; $dnscounter++) {
|
||||
$dnsitem = "dns{$dnscounter}";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user