diff options
author | Chris Buechler <cmb@pfsense.org> | 2016-04-20 23:29:04 -0500 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2016-04-20 23:29:33 -0500 |
commit | c0358d44632b962a12a948e750dadcadb2d21997 (patch) | |
tree | 1286646ef55346011b42bba2bc54f234d34ca013 /src/usr/local/www/firewall_virtual_ip_edit.php | |
parent | fce2379876f99e1ea248f07ca2830867c5e0f2f6 (diff) | |
download | pfsense-c0358d44632b962a12a948e750dadcadb2d21997.zip pfsense-c0358d44632b962a12a948e750dadcadb2d21997.tar.gz |
Add validation of address family on IP aliases with CARP parent. Ticket #6218
Diffstat (limited to 'src/usr/local/www/firewall_virtual_ip_edit.php')
-rw-r--r-- | src/usr/local/www/firewall_virtual_ip_edit.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/usr/local/www/firewall_virtual_ip_edit.php b/src/usr/local/www/firewall_virtual_ip_edit.php index b94473c..e928d8f 100644 --- a/src/usr/local/www/firewall_virtual_ip_edit.php +++ b/src/usr/local/www/firewall_virtual_ip_edit.php @@ -216,7 +216,16 @@ if ($_POST) { break; case 'ipalias': - /* ipalias works fine with localhost and CARP. */ + /* verify IP alias on CARP has proper address family */ + if (strstr($_POST['interface'], '_vip')) { + $vipif = get_configured_vip($_POST['interface']); + if (is_ipaddrv4($_POST['subnet']) && is_ipaddrv6($vipif['subnet'])) { + $input_errors[] = gettext("An IPv4 Virtual IP cannot have an IPv6 CARP parent."); + } + if (is_ipaddrv6($_POST['subnet']) && is_ipaddrv4($vipif['subnet'])) { + $input_errors[] = gettext("An IPv6 Virtual IP cannot have an IPv4 CARP parent."); + } + } break; default: if ($_POST['interface'] == 'lo0') { |