diff options
author | smos <seth.mos@dds.nl> | 2012-01-15 12:40:38 +0100 |
---|---|---|
committer | smos <seth.mos@dds.nl> | 2012-01-15 12:40:38 +0100 |
commit | 35af71416e19868fd09ec6701114c208fa4a1c4d (patch) | |
tree | e02ac3623777eeb8bcb31be2a94e7d53e6809c1f /usr | |
parent | 0c305760d1b7a431b21445e7f5436c5571e98392 (diff) | |
download | pfsense-35af71416e19868fd09ec6701114c208fa4a1c4d.zip pfsense-35af71416e19868fd09ec6701114c208fa4a1c4d.tar.gz |
Fix for ticket 2071, this allows link local addresses for gateways.
Backend already added the interface scope for link local addresses, hurrah.
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/system_gateways_edit.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php index c7cb10a..86cb0c8 100755 --- a/usr/local/www/system_gateways_edit.php +++ b/usr/local/www/system_gateways_edit.php @@ -128,9 +128,12 @@ if ($_POST) { 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); + /* do not do a subnet match on a link local address, it's valid */ + if(! preg_match("/fe80::/", $_POST['gateway'])) { + $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); + } } } |