aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/quagga_ospfd/quagga_ospfd.inc33
-rw-r--r--config/quagga_ospfd/quagga_ospfd.xml7
-rw-r--r--pkg_config.10.xml2
-rw-r--r--pkg_config.8.xml2
-rw-r--r--pkg_config.8.xml.amd642
5 files changed, 42 insertions, 4 deletions
diff --git a/config/quagga_ospfd/quagga_ospfd.inc b/config/quagga_ospfd/quagga_ospfd.inc
index d0c73263..3b5c153d 100644
--- a/config/quagga_ospfd/quagga_ospfd.inc
+++ b/config/quagga_ospfd/quagga_ospfd.inc
@@ -422,4 +422,37 @@ function quagga_get_carp_status_by_ip($ipaddr) {
return $status;
}
+function quagga_plugin_carp($pluginparams) {
+ global $config;
+ require_once("service-utils.inc");
+ // Called when a CARP interface changes state
+ // $pluginparams['event'] either 'rc.carpmaster' or 'rc.carpbackup'
+ // $pluginparams['interface'] contains the affected interface
+
+ /* If there is no OSPF config, then stop */
+ if(is_array($config['installedpackages']['quaggaospfd']['config'])) {
+ $ospfd_conf = &$config['installedpackages']['quaggaospfd']['config'][0];
+ } else {
+ return null;
+ }
+ /* If there is no properly configured CARP status check IP, then stop */
+ if (!is_ipaddr($ospfd_conf['carpstatusip'])) {
+ return null;
+ }
+ list($vhid, $iface) = explode("@", trim($pluginparams['interface']));
+ $friendly = convert_real_interface_to_friendly_interface_name($iface);
+ $carp_iface = "{$friendly}_vip${vhid}";
+
+ /* If this CARP transition is not from the IP address to check, then stop. */
+ if (get_interface_ip($carp_iface) != $ospfd_conf['carpstatusip']) {
+ return null;
+ }
+
+ /* Start or stop the service as needed based on the CARP transition. */
+ if ($pluginparams['event'] == "rc.carpmaster") {
+ start_service("Quagga OSPFd");
+ } elseif ($pluginparams['event'] == "rc.carpbackup") {
+ stop_service("Quagga OSPFd");
+ }
+}
?>
diff --git a/config/quagga_ospfd/quagga_ospfd.xml b/config/quagga_ospfd/quagga_ospfd.xml
index 7964d1c0..5de2e3f8 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.3</version>
+ <version>0.6.4</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>
@@ -67,6 +67,11 @@
<executable>zebra</executable>
<description>Quagga core/abstraction daemon</description>
</service>
+ <plugins>
+ <item>
+ <type>plugin_carp</type>
+ </item>
+ </plugins>
<fields>
<field>
<fielddescr>Master Password</fielddescr>
diff --git a/pkg_config.10.xml b/pkg_config.10.xml
index 4ceb53b0..a37cb595 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.3</version>
+ <version>0.99.22.3.1_2 v0.6.4</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 fc759871..681f530d 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.3</version>
+ <version>0.99.22.3 v0.6.4</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 fba917f4..c41ec11e 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.3</version>
+ <version>0.99.22.3 v0.6.4</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>