From: Martin Willi Date: Tue, 15 Sep 2009 11:53:06 +0000 (+0200) Subject: create external fifo socket only if "fifo_interface" option is set X-Git-Tag: 4.4.0~88 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f5632db9538d8270254078c90a0fc46074808f37;p=thirdparty%2Fstrongswan.git create external fifo socket only if "fifo_interface" option is set --- diff --git a/src/charon/plugins/ha_sync/ha_sync_plugin.c b/src/charon/plugins/ha_sync/ha_sync_plugin.c index 73d3a11b5e..027bc10dc9 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; }