summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-07-28 12:31:16 +0000
committerErmal <eri@pfsense.org>2010-07-28 12:31:16 +0000
commit8e2986f8486237a964aa0890d335596a4da30c41 (patch)
treec2718cc91cba2a687dd46c9a571a7c881dd76f0d /usr
parent7fbd5e146ed65cea04fc410ec2cf8353681ff782 (diff)
downloadpfsense-8e2986f8486237a964aa0890d335596a4da30c41.zip
pfsense-8e2986f8486237a964aa0890d335596a4da30c41.tar.gz
Fixes #761. Correctly bring down/up all vips based on the button click in the webGUI.
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/carp_status.php41
1 files changed, 34 insertions, 7 deletions
diff --git a/usr/local/www/carp_status.php b/usr/local/www/carp_status.php
index 44dee95..15502b9 100755
--- a/usr/local/www/carp_status.php
+++ b/usr/local/www/carp_status.php
@@ -55,18 +55,45 @@ if($_POST['disablecarp'] <> "") {
if($status == true) {
$carp_ints = get_all_carp_interfaces();
mwexec("/sbin/sysctl net.inet.carp.allow=0");
- $carp_counter = find_number_of_created_carp_interfaces();
- if (is_array($carp_ints)) {
- foreach($carp_ints as $int) {
- mwexec("/sbin/ifconfig $int down");
- mwexec("/sbin/ifconfig $int destroy");
- }
- }
+ if(is_array($config['virtualip']['vip'])) {
+ $viparr = &$config['virtualip']['vip'];
+ foreach ($viparr as $vip) {
+ if (in_array($vip['carpif'], $carps)) {
+ switch ($vip['mode']) {
+ case "carp":
+ interface_vip_bring_down($vip);
+ sleep(1);
+ break;
+ case "carpdev-dhcp":
+ interface_vip_bring_down($vip);
+ sleep(1);
+ break;
+ }
+ }
+ }
+ }
$savemsg = "{$carp_counter} IPs have been disabled.";
} else {
$savemsg = "CARP has been enabled.";
mwexec("/sbin/sysctl net.inet.carp.allow=1");
interfaces_carp_setup();
+ if(is_array($config['virtualip']['vip'])) {
+ $viparr = &$config['virtualip']['vip'];
+ foreach ($viparr as $vip) {
+ if (in_array($vip['carpif'], $carps)) {
+ switch ($vip['mode']) {
+ case "carp":
+ interface_carp_configure($vip);
+ sleep(1);
+ break;
+ case "carpdev-dhcp":
+ interface_carpdev_configure($vip);
+ sleep(1);
+ break;
+ }
+ }
+ }
+ }
}
}
OpenPOWER on IntegriCloud