summaryrefslogtreecommitdiffstats
path: root/usr/local/www/system_gateways_edit.php
diff options
context:
space:
mode:
authorsmos <seth.mos@dds.nl>2012-03-13 20:39:42 +0100
committersmos <seth.mos@dds.nl>2012-03-13 20:39:42 +0100
commit2a9cb3b2a8825d2e8a338769abb789f810a5fe12 (patch)
tree8efd9fd372e1a0e04fce28f8cce57c7663d098c9 /usr/local/www/system_gateways_edit.php
parent4096fe5da7c3827df3f3c55a04b40998a54b3047 (diff)
downloadpfsense-2a9cb3b2a8825d2e8a338769abb789f810a5fe12.zip
pfsense-2a9cb3b2a8825d2e8a338769abb789f810a5fe12.tar.gz
Fix the link local check when trying to add a link local gateway
Ticket #2071
Diffstat (limited to 'usr/local/www/system_gateways_edit.php')
-rwxr-xr-xusr/local/www/system_gateways_edit.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php
index 86cb0c8..a9f28cf 100755
--- a/usr/local/www/system_gateways_edit.php
+++ b/usr/local/www/system_gateways_edit.php
@@ -123,13 +123,13 @@ if ($_POST) {
}
}
if(is_ipaddrv6($_POST['gateway'])) {
- $parent_ip = get_interface_ipv6($_POST['interface']);
- $parent_sn = get_interface_subnetv6($_POST['interface']);
- if(empty($parent_ip) || empty($parent_sn)) {
- $input_errors[] = gettext("You can not use a IPv4 Gateway Address on a IPv6 only interface.");
- } else {
- /* do not do a subnet match on a link local address, it's valid */
- if(! preg_match("/fe80::/", $_POST['gateway'])) {
+ /* do not do a subnet match on a link local address, it's valid */
+ if(! preg_match("/fe80::/", $_POST['gateway'])) {
+ $parent_ip = get_interface_ipv6($_POST['interface']);
+ $parent_sn = get_interface_subnetv6($_POST['interface']);
+ if(empty($parent_ip) || empty($parent_sn)) {
+ $input_errors[] = gettext("You can not use a IPv4 Gateway Address on a IPv6 only interface.");
+ } else {
$subnet = gen_subnetv6($parent_ip, $parent_sn) . "/" . $parent_sn;
if(!ip_in_subnet($_POST['gateway'], $subnet))
$input_errors[] = sprintf(gettext("The gateway address %1\$s does not lie within the chosen interface's subnet '%2\$s'."), $_POST['gateway'],$subnet);
OpenPOWER on IntegriCloud