diff options
author | Renato Botelho <garga@FreeBSD.org> | 2014-08-25 12:31:37 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2014-08-25 12:31:37 -0300 |
commit | d59716931f6d6b0387a39de3df2422c0410d99eb (patch) | |
tree | 76e1938f082c5c974349b88e90d92093464c83cf /usr | |
parent | cbeeb6d4ff3db1dccae5637e049ad9e0c81462cb (diff) | |
download | pfsense-d59716931f6d6b0387a39de3df2422c0410d99eb.zip pfsense-d59716931f6d6b0387a39de3df2422c0410d99eb.tar.gz |
Fix #3807:
* When changing a pre existing VIP, use previous configured interface
for checking, this fixes the issue that happens when you try to change
a VIP to a new interface.
* Use the right interface name, only carp uses _vipN suffix
Diffstat (limited to 'usr')
-rw-r--r-- | usr/local/www/firewall_virtual_ip_edit.php | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/usr/local/www/firewall_virtual_ip_edit.php b/usr/local/www/firewall_virtual_ip_edit.php index bf48e12..c33166b 100644 --- a/usr/local/www/firewall_virtual_ip_edit.php +++ b/usr/local/www/firewall_virtual_ip_edit.php @@ -113,8 +113,23 @@ if ($_POST) { if ($_POST['subnet']) { if (!is_ipaddr($_POST['subnet'])) $input_errors[] = gettext("A valid IP address must be specified."); - else if (is_ipaddr_configured($_POST['subnet'], "{$_POST['interface']}_vip{$id}")) - $input_errors[] = gettext("This IP address is being used by another interface or VIP."); + else { + if (isset($id) && isset($a_vip[$id])) { + $ignore_if = $a_vip[$id]['interface']; + $ignore_mode = $a_vip[$id]['mode']; + } else { + $ignore_if = $_POST['interface']; + $ignore_mode = $_POST['mode']; + } + + if ($ignore_mode == 'carp') + $ignore_if .= "_vip{$id}"; + + if (is_ipaddr_configured($_POST['subnet'], $ignore_if)) + $input_errors[] = gettext("This IP address is being used by another interface or VIP."); + + unset($ignore_if, $ignore_mode); + } } $natiflist = get_configured_interface_with_descr(); |