mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Ticket #1023. Correct carp status even on the status page.
This commit is contained in:
parent
108cfddf3e
commit
4ed5ad5a91
@ -320,9 +320,8 @@ function setup_microcode() {
|
||||
******/
|
||||
function get_carp_status() {
|
||||
/* grab the current status of carp */
|
||||
$status = `/sbin/sysctl net.inet.carp.allow | cut -d" " -f2`;
|
||||
if(intval($status) == "0") return false;
|
||||
return true;
|
||||
$status = `/sbin/sysctl -n net.inet.carp.allow`;
|
||||
return (intval($status) > 0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@ -47,13 +47,11 @@ function gentitle_pkg($pgname) {
|
||||
|
||||
unset($interface_arr_cache);
|
||||
unset($carp_interface_count_cache);
|
||||
unset($carp_query);
|
||||
unset($interface_ip_arr_cache);
|
||||
|
||||
$status = get_carp_status();
|
||||
if($_POST['disablecarp'] <> "") {
|
||||
if($status == true) {
|
||||
$carp_ints = get_all_carp_interfaces();
|
||||
mwexec("/sbin/sysctl net.inet.carp.allow=0");
|
||||
if(is_array($config['virtualip']['vip'])) {
|
||||
$viparr = &$config['virtualip']['vip'];
|
||||
@ -112,8 +110,10 @@ include("head.inc");
|
||||
<?php
|
||||
if(is_array($config['virtualip']['vip'])) {
|
||||
foreach($config['virtualip']['vip'] as $carp) {
|
||||
if ($carp['mode'] == "carp")
|
||||
if ($carp['mode'] == "carp") {
|
||||
$carpcount++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if($carpcount > 0) {
|
||||
@ -146,13 +146,14 @@ include("head.inc");
|
||||
|
||||
if(is_array($config['virtualip']['vip'])) {
|
||||
foreach($config['virtualip']['vip'] as $carp) {
|
||||
if ($carp['mode'] != "carp") continue;
|
||||
if ($carp['mode'] != "carp")
|
||||
continue;
|
||||
$ipaddress = $carp['subnet'];
|
||||
$password = $carp['password'];
|
||||
$netmask = $carp['subnet_bits'];
|
||||
$vhid = $carp['vhid'];
|
||||
$advskew = $carp['advskew'];
|
||||
$carp_int = find_carp_interface($ipaddress);
|
||||
$carp_int = "vip{$vhid}";
|
||||
$status = get_carp_interface_status($carp_int);
|
||||
echo "<tr>";
|
||||
$align = "valign='middle'";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user