summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2008-05-25 00:33:28 +0000
committerScott Ullrich <sullrich@pfsense.org>2008-05-25 00:33:28 +0000
commit37e9212c9b669f490f94d1dc6b03d94ae6b95cd2 (patch)
treeabcd6017bdf99f11ada3148e333e57a9d4fb86c0
parent3fceab6c8948caf7669b282abd4f00cd3ca934e7 (diff)
downloadpfsense-37e9212c9b669f490f94d1dc6b03d94ae6b95cd2.zip
pfsense-37e9212c9b669f490f94d1dc6b03d94ae6b95cd2.tar.gz
CarDEV DHCP fixes.
-rw-r--r--etc/inc/interfaces.inc15
-rwxr-xr-xusr/local/www/firewall_virtual_ip.php6
2 files changed, 14 insertions, 7 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index 4b86879..d1a4f97 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -516,7 +516,7 @@ function interfaces_carp_configure() {
mwexec("/sbin/sysctl net.inet.carp.allow=0");
}
foreach ($viparr as $vip) {
- if ($vip['mode'] == "carp") {
+ if ($vip['mode'] == "carp" or $vip['mode'] == "carpdev-dhcp") {
$vip_password = $vip['password'];
$vip_password = str_replace(" ", "", $vip_password);
@@ -535,7 +535,7 @@ function interfaces_carp_configure() {
if (ip_in_subnet($vip['subnet'], gen_subnet($ww_subnet_ip, $ww_subnet_bits) . "/" . $ww_subnet_bits))
$found = true;
}
- if($found == false and $vip['type'] =="carp") {
+ if($found == false and $vip['mode'] =="carp") {
file_notice("CARP", "Sorry but we could not find a matching real interface subnet for the virtual IP address {$vip['subnet']}.", "Firewall: Virtual IP", "");
continue;
}
@@ -544,17 +544,18 @@ function interfaces_carp_configure() {
/* invalidate interface cache */
get_interface_arr(true);
- if($vip['type'] =="carp")
+ if($vip['mode'] =="carp")
$broadcast_address = gen_subnet_max($vip['subnet'], $vip['subnet_bits']);
if($vip['password'] != "")
$password = " pass \"" . $vip_password . "\"";
- if($vip['type'] =="carp") {
+ if($vip['mode'] =="carp") {
mwexec("/sbin/ifconfig carp" . $carp_instances_counter . " " . $vip['subnet'] . "/" . $vip['subnet_bits'] . " broadcast " . $broadcast_address . " vhid " . $vip['vhid'] . " advskew 200 " . $password);
mwexec("/sbin/ifconfig carp" . $carp_instances_counter . " up");
}
- if($vip['type'] =="carpdev-dhcp") {
+ if($vip['mode'] =="carpdev-dhcp") {
+ log_error("Found carpdev interface {$vip['interface']}");
$interface = convert_friendly_interface_to_real_interface_name($vip['interface']);
if($interface) {
exec("ifconfig carp{$carp_instances_counter} carpdev $interface");
@@ -629,12 +630,12 @@ function interfaces_carp_bring_up_final() {
if($vip['password'] != "")
$password = " pass " . $vip['password'];
- if($vip['type'] =="carp") {
+ if($vip['mode'] =="carp") {
mwexec("/sbin/ifconfig carp" . $carp_instances_counter . " " . $vip['subnet'] . "/" . $vip['subnet_bits'] . " broadcast " . $broadcast_address . " vhid " . $vip['vhid'] . " advskew " . $vip['advskew'] . $password);
mwexec("/sbin/ifconfig carp" . $carp_instances_counter . " up");
}
- if($vip['type'] =="carpdev-dhcp") {
+ if($vip['mode'] =="carpdev-dhcp") {
$interface = convert_friendly_interface_to_real_interface_name($vip['interface']);
if($interface)
exec("ifconfig carp{$carp_instances_counter} carpdev $interface");
diff --git a/usr/local/www/firewall_virtual_ip.php b/usr/local/www/firewall_virtual_ip.php
index 8c2d9e4..a6b4c0c 100755
--- a/usr/local/www/firewall_virtual_ip.php
+++ b/usr/local/www/firewall_virtual_ip.php
@@ -57,6 +57,12 @@ if ($_POST) {
$retval |= filter_configure();
config_unlock();
interfaces_ipalias_configure();
+
+ /* reset carp states */
+ reset_carp();
+ interfaces_carp_configure();
+ interfaces_carp_bring_up_final();
+
$savemsg = get_std_save_message($retval);
unlink_if_exists($d_vipconfdirty_path);
}
OpenPOWER on IntegriCloud