summaryrefslogtreecommitdiffstats
path: root/usr/local/www/system_gateways_edit.php
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@dds.nl>2010-11-02 21:43:07 +0100
committerSeth Mos <seth.mos@dds.nl>2010-11-02 21:43:07 +0100
commit7617e245bb6886848a23cd453fb720eefe2bff8b (patch)
tree3f8ce8a61a20bfdda7da6a976e86096164a1f690 /usr/local/www/system_gateways_edit.php
parent27b82e7cee50762b61b796223602ec896b32136c (diff)
downloadpfsense-7617e245bb6886848a23cd453fb720eefe2bff8b.zip
pfsense-7617e245bb6886848a23cd453fb720eefe2bff8b.tar.gz
Verify that we validate against a ipv6 subnet properly. This should help for static route gateways
Diffstat (limited to 'usr/local/www/system_gateways_edit.php')
-rwxr-xr-xusr/local/www/system_gateways_edit.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php
index 8db2853..166e6ab 100755
--- a/usr/local/www/system_gateways_edit.php
+++ b/usr/local/www/system_gateways_edit.php
@@ -118,12 +118,18 @@ if ($_POST) {
} else {
$parent_ip = get_interface_ip($_POST['interface']);
}
- if (is_ipaddr($parent_ip)) {
+ if (is_ipaddrv4($parent_ip)) {
$parent_sn = get_interface_subnet($_POST['interface']);
if(!ip_in_subnet($_POST['gateway'], gen_subnet($parent_ip, $parent_sn) . "/" . $parent_sn)) {
$input_errors[] = sprintf(gettext("The gateway address %s does not lie within the chosen interface's subnet."), $_POST['gateway']);
}
}
+ if (is_ipaddrv6($parent_ip)) {
+ $parent_sn = get_interface_subnetv6($_POST['interface']);
+ if(!ip_in_subnet($_POST['gateway'], gen_subnetv6($parent_ip, $parent_sn) . "/" . $parent_sn)) {
+ $input_errors[] = sprintf(gettext("The gateway address %s does not lie within the chosen interface's subnet."), $_POST['gateway']);
+ }
+ }
}
if (($_POST['monitor'] <> "") && !is_ipaddr($_POST['monitor']) && $_POST['monitor'] != "dynamic") {
$input_errors[] = gettext("A valid monitor IP address must be specified.");
OpenPOWER on IntegriCloud