From f5632db9538d8270254078c90a0fc46074808f37 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Tue, 15 Sep 2009 13:53:06 +0200 Subject: [PATCH] create external fifo socket only if "fifo_interface" option is set --- src/charon/plugins/ha_sync/ha_sync_plugin.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/charon/plugins/ha_sync/ha_sync_plugin.c b/src/charon/plugins/ha_sync/ha_sync_plugin.c index 73d3a11b5..027bc10dc 100644 --- a/src/charon/plugins/ha_sync/ha_sync_plugin.c +++ b/src/charon/plugins/ha_sync/ha_sync_plugin.c @@ -72,12 +72,15 @@ struct private_ha_sync_plugin_t { */ static void destroy(private_ha_sync_plugin_t *this) { + if (this->ctl) + { + this->ctl->destroy(this->ctl); + } charon->bus->remove_listener(charon->bus, &this->ike->listener); charon->bus->remove_listener(charon->bus, &this->child->listener); this->ike->destroy(this->ike); this->child->destroy(this->child); this->dispatcher->destroy(this->dispatcher); - this->ctl->destroy(this->ctl); this->segments->destroy(this->segments); this->socket->destroy(this->socket); free(this); @@ -99,12 +102,17 @@ plugin_t *plugin_create() return NULL; } this->segments = ha_sync_segments_create(); - this->ctl = ha_sync_ctl_create(this->segments); this->dispatcher = ha_sync_dispatcher_create(this->socket); this->ike = ha_sync_ike_create(this->socket); this->child = ha_sync_child_create(this->socket); charon->bus->add_listener(charon->bus, &this->ike->listener); charon->bus->add_listener(charon->bus, &this->child->listener); + this->ctl = NULL; + if (lib->settings->get_bool(lib->settings, + "charon.plugins.ha_sync.fifo_interface", FALSE)) + { + this->ctl = ha_sync_ctl_create(this->segments); + } return &this->public.plugin; }