aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2015-02-24 11:44:07 -0500
committerjim-p <jimp@pfsense.org>2015-02-24 11:44:20 -0500
commiteab2c01b14b6c7af5a6475fc76e494dbababd3d6 (patch)
treeccc4be90e36b75639fb59ca7a0a52f7c80a1b56b /config
parent2fa6302094d89e78ba14ce12626f84ba2f92313e (diff)
downloadpfsense-packages-eab2c01b14b6c7af5a6475fc76e494dbababd3d6.tar.gz
pfsense-packages-eab2c01b14b6c7af5a6475fc76e494dbababd3d6.tar.bz2
pfsense-packages-eab2c01b14b6c7af5a6475fc76e494dbababd3d6.zip
Fix CARP status check for 2.2
Diffstat (limited to 'config')
-rw-r--r--config/quagga_ospfd/quagga_ospfd.inc31
-rw-r--r--config/quagga_ospfd/quagga_ospfd.xml2
2 files changed, 30 insertions, 3 deletions
diff --git a/config/quagga_ospfd/quagga_ospfd.inc b/config/quagga_ospfd/quagga_ospfd.inc
index 17c13246..d0c73263 100644
--- a/config/quagga_ospfd/quagga_ospfd.inc
+++ b/config/quagga_ospfd/quagga_ospfd.inc
@@ -266,8 +266,14 @@ function quagga_ospfd_install_conf() {
$carp_ip_status_check = "";
if (is_ipaddr($ospfd_conf['carpstatusip'])) {
- $carpcheckinterface = trim(find_carp_interface($ospfd_conf['carpstatusip']));
- $carp_ip_status_check = <<<EOF
+
+ $pfs_version = substr(trim(file_get_contents("/etc/version")),0,3);
+ switch ($pfs_version) {
+ case "2.0":
+ case "2.1":
+ /* Check for 2.1 and before */
+ $carpcheckinterface = trim(find_carp_interface($ospfd_conf['carpstatusip']));
+ $carp_ip_status_check = <<<EOF
CARP_STATUS=`/sbin/ifconfig {$carpcheckinterface} | /usr/bin/grep carp: | /usr/bin/awk '{print \$2;}'`
if [ \${CARP_STATUS} != "MASTER" ]; then
@@ -275,6 +281,27 @@ if [ \${CARP_STATUS} != "MASTER" ]; then
fi
EOF;
+ break;
+ case "2.2":
+ default:
+ /* Check for 2.2 and later */
+ if (is_array($config['virtualip']['vip'])) {
+ foreach ($config['virtualip']['vip'] as $vip) {
+ if (($vip['mode'] == "carp") && ($vip['subnet'] == $ospfd_conf['carpstatusip'])) {
+ $carpcheckinterface = escapeshellarg(get_real_interface($vip['interface']));
+ $vhid = escapeshellarg($vip['vhid']);
+ $carp_ip_status_check = <<<EOF
+
+CARP_STATUS=`/sbin/ifconfig {$carpcheckinterface} | /usr/bin/grep 'carp:' | /usr/bin/grep 'vhid {$vhid}' | /usr/bin/awk '{print \$2;}'`
+if [ \${CARP_STATUS} != "MASTER" ]; then
+ exit;
+fi
+EOF;
+ }
+ }
+ }
+ break;
+ }
}
diff --git a/config/quagga_ospfd/quagga_ospfd.xml b/config/quagga_ospfd/quagga_ospfd.xml
index 8edfcc3f..7964d1c0 100644
--- a/config/quagga_ospfd/quagga_ospfd.xml
+++ b/config/quagga_ospfd/quagga_ospfd.xml
@@ -1,6 +1,6 @@
<packagegui>
<name>quagga_ospfd</name>
- <version>0.6.1</version>
+ <version>0.6.3</version>
<title>Services: Quagga OSPFd</title>
<include_file>/usr/local/pkg/quagga_ospfd.inc</include_file>
<aftersaveredirect>pkg_edit.php?xml=quagga_ospfd.xml&amp;id=0</aftersaveredirect>