summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsmos <seth.mos@dds.nl>2012-05-20 20:57:05 +0200
committersmos <seth.mos@dds.nl>2012-05-20 20:57:05 +0200
commit96cd928ba2a7343634b814e8b3ff910bafd78cdc (patch)
tree59e070141ec0ca9a7a92484073dca9cd1ca7830d
parent793d3c961dfc19f69819c995dfaec0084b0f2222 (diff)
downloadpfsense-96cd928ba2a7343634b814e8b3ff910bafd78cdc.zip
pfsense-96cd928ba2a7343634b814e8b3ff910bafd78cdc.tar.gz
Allow saving on system.php if the gateways are down.
-rw-r--r--etc/inc/gwlb.inc19
-rwxr-xr-xusr/local/www/system.php4
2 files changed, 13 insertions, 10 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc
index 1e694cf..e87a7c1 100644
--- a/etc/inc/gwlb.inc
+++ b/etc/inc/gwlb.inc
@@ -877,14 +877,17 @@ function validate_address_family($ipaddr, $gwname) {
$v4gw = true;
if(is_ipaddrv6(lookup_gateway_ip_by_name($gwname)))
$v6gw = true;
- /* are they dynamic */
- switch($gwname) {
- case "dynamic":
- $v4gw = true;
- break;
- case "dynamic6":
- $v6gw = true;
- break;
+
+ $gw_array = return_gateways_array();
+ if(is_array($gw_array[$gwname])) {
+ switch($gw_array[$gwname]['ipprotocol']) {
+ case "inet":
+ $v4gw = true;
+ break;
+ case "inet6":
+ $v6gw = true;
+ break;
+ }
}
if($v4ip && $v4gw)
diff --git a/usr/local/www/system.php b/usr/local/www/system.php
index d149e11..75896a6 100755
--- a/usr/local/www/system.php
+++ b/usr/local/www/system.php
@@ -128,8 +128,8 @@ if ($_POST) {
if (($_POST[$dnsname] && !is_ipaddr($_POST[$dnsname]))) {
$input_errors[] = gettext("A valid IP address must be specified for the DNS server $dnscounter.");
}
- if (($_POST[$dnsgwname] <> "none") && (is_ipaddr($_POST[$dnsname])) && (validate_address_family($_POST[$dnsname], lookup_gateway_ip_by_name($_POST[$dnsgwname])) === false )) {
- $input_errors[] = gettext("The gateway specified for DNS server '{$_POST[$dnsname]}' is not from the same Address Family as gateway '". lookup_gateway_ip_by_name($_POST[$dnsgwname]) ."'.");
+ if (($_POST[$dnsgwname] <> "none") && (is_ipaddr($_POST[$dnsname])) && (validate_address_family($_POST[$dnsname], $_POST[$dnsgwname]) === false )) {
+ $input_errors[] = gettext("The gateway specified for DNS server '{$_POST[$dnsname]}' is not from the same Address Family as gateway '". $_POST[$dnsgwname] ."'.");
}
}
OpenPOWER on IntegriCloud