diff options
author | jim-p <jimp@pfsense.org> | 2015-02-24 11:44:07 -0500 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2015-02-24 11:44:20 -0500 |
commit | eab2c01b14b6c7af5a6475fc76e494dbababd3d6 (patch) | |
tree | ccc4be90e36b75639fb59ca7a0a52f7c80a1b56b | |
parent | 2fa6302094d89e78ba14ce12626f84ba2f92313e (diff) | |
download | pfsense-packages-eab2c01b14b6c7af5a6475fc76e494dbababd3d6.tar.gz pfsense-packages-eab2c01b14b6c7af5a6475fc76e494dbababd3d6.tar.bz2 pfsense-packages-eab2c01b14b6c7af5a6475fc76e494dbababd3d6.zip |
Fix CARP status check for 2.2
-rw-r--r-- | config/quagga_ospfd/quagga_ospfd.inc | 31 | ||||
-rw-r--r-- | config/quagga_ospfd/quagga_ospfd.xml | 2 | ||||
-rw-r--r-- | pkg_config.10.xml | 2 | ||||
-rw-r--r-- | pkg_config.8.xml | 2 | ||||
-rw-r--r-- | pkg_config.8.xml.amd64 | 2 |
5 files changed, 33 insertions, 6 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&id=0</aftersaveredirect> diff --git a/pkg_config.10.xml b/pkg_config.10.xml index 90ece8ee..4ceb53b0 100644 --- a/pkg_config.10.xml +++ b/pkg_config.10.xml @@ -1167,7 +1167,7 @@ <name>Quagga OSPF</name> <descr>OSPF routing protocol using Quagga -- WARNING! Installs files to the same place as OpenBGPD. Installing both will break things.</descr> <maintainer>jimp@pfsense.org</maintainer> - <version>0.99.22.3.1_2 v0.6.2</version> + <version>0.99.22.3.1_2 v0.6.3</version> <category>Routing</category> <status>BETA</status> <depends_on_package_pbi>quagga-0.99.23.1_2-##ARCH##.pbi</depends_on_package_pbi> diff --git a/pkg_config.8.xml b/pkg_config.8.xml index c0fab064..fc759871 100644 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -1606,7 +1606,7 @@ <name>Quagga OSPF</name> <descr>OSPF routing protocol using Quagga -- WARNING! Installs files to the same place as OpenBGPD. Installing both will break things.</descr> <maintainer>jimp@pfsense.org</maintainer> - <version>0.99.22.3 v0.6.2</version> + <version>0.99.22.3 v0.6.3</version> <category>Routing</category> <status>BETA</status> <depends_on_package_base_url>https://files.pfsense.org/packages/8/All/</depends_on_package_base_url> diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64 index 8a9235c7..fba917f4 100644 --- a/pkg_config.8.xml.amd64 +++ b/pkg_config.8.xml.amd64 @@ -1593,7 +1593,7 @@ <name>Quagga OSPF</name> <descr>OSPF routing protocol using Quagga -- WARNING! Installs files to the same place as OpenBGPD. Installing both will break things.</descr> <maintainer>jimp@pfsense.org</maintainer> - <version>0.99.22.3 v0.6.2</version> + <version>0.99.22.3 v0.6.3</version> <category>Routing</category> <status>BETA</status> <depends_on_package_base_url>https://files.pfsense.org/packages/amd64/8/All/</depends_on_package_base_url> |