summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2014-11-10 14:00:30 (GMT)
committerErmal <eri@pfsense.org>2014-11-10 14:00:30 (GMT)
commit5063f1df931b2887e2da2560c73fef954656e4e8 (patch)
tree6dc55e05e7936c41238a135461fdeb4dd53bc410
parent9c97df267fd4f3c6c638466a54482e3d2c1b2986 (diff)
downloadunivnautes-5063f1df931b2887e2da2560c73fef954656e4e8.zip
univnautes-5063f1df931b2887e2da2560c73fef954656e4e8.tar.gz
univnautes-5063f1df931b2887e2da2560c73fef954656e4e8.tar.bz2
Ticket #3967. Allow to have carp as parent of ipaliases - continued
-rw-r--r--etc/inc/filter.inc2
-rw-r--r--etc/inc/interfaces.inc9
-rw-r--r--etc/phpshellsessions/enablecarp10
-rw-r--r--usr/local/www/carp_status.php4
-rw-r--r--usr/local/www/firewall_virtual_ip.php6
5 files changed, 27 insertions, 4 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 8c76128..7bd342c 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -3641,7 +3641,7 @@ function filter_generate_ipsec_rules($log = array()) {
}
}
- if (strstr($ph1ent['interface'], "_vip"))
+ if (strpos($ph1ent['interface'], "_vip"))
list($parentinterface, $vhid) = explode("_vhid", $ph1ent['interface']);
else
$parentinterface = $ph1ent['interface'];
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index e3067d6..f560b38 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -4151,6 +4151,15 @@ function get_current_wan_address($interface = "wan") {
function convert_real_interface_to_friendly_interface_name($interface = "wan") {
global $config;
+ if (stripos($interface, "_vip")) {
+ foreach ($config['virtualip']['vip'] as $counter => $vip) {
+ if ($vip['mode'] == "carp") {
+ if ($interface == "{$vip['interface']}_vip{$vip['vhid']}")
+ return $vip['interface'];
+ }
+ }
+ }
+
/* XXX: For speed reasons reference directly the interface array */
$ifdescrs = &$config['interfaces'];
//$ifdescrs = get_configured_interface_list(false, true);
diff --git a/etc/phpshellsessions/enablecarp b/etc/phpshellsessions/enablecarp
index b1c4a43..c02a606 100644
--- a/etc/phpshellsessions/enablecarp
+++ b/etc/phpshellsessions/enablecarp
@@ -7,9 +7,13 @@ if(is_array($config['virtualip']['vip'])) {
$viparr = &$config['virtualip']['vip'];
foreach ($viparr as $vip) {
switch ($vip['mode']) {
- case "carp":
- interface_carp_configure($vip);
- sleep(1);
+ case "carp":
+ interface_carp_configure($vip);
+ sleep(1);
+ break;
+ case "ipalias":
+ if (strpos($vip['interface'], '_vip'))
+ interface_ipalias_configure($vip);
break;
}
}
diff --git a/usr/local/www/carp_status.php b/usr/local/www/carp_status.php
index 869cc1b..5701ad7 100644
--- a/usr/local/www/carp_status.php
+++ b/usr/local/www/carp_status.php
@@ -81,6 +81,10 @@ if($_POST['disablecarp'] <> "") {
sleep(1);
break;
}
+ case 'ipalias':
+ if (strpos($vip['interface'], '_vip'))
+ interface_ipalias_configure($vip);
+ break;
}
}
interfaces_sync_setup();
diff --git a/usr/local/www/firewall_virtual_ip.php b/usr/local/www/firewall_virtual_ip.php
index f4aa0d3..f3703f9 100644
--- a/usr/local/www/firewall_virtual_ip.php
+++ b/usr/local/www/firewall_virtual_ip.php
@@ -162,6 +162,12 @@ if ($_GET['act'] == "del") {
if ($found_carp === true && $found_other_alias === false && $found_if === false)
$input_errors[] = gettext("This entry cannot be deleted because it is still referenced by a CARP IP with the description") . " {$vip['descr']}.";
+ } else if ($a_vip[$_GET['id']]['mode'] == "carp") {
+ $vipiface = "{$a_vip[$_GET['id']]['interface']}_vip{$a_vip[$_GET['id']]['vhid']}";
+ foreach ($a_vip as $vip) {
+ if ($vipiface == $vip['interface'] && $vip['mode'] == "ipalias")
+ $input_errors[] = gettext("This entry cannot be deleted because it is still referenced by an IP alias entry with the description") . " {$vip['descr']}.";
+ }
}
if (!$input_errors) {