aboutsummaryrefslogtreecommitdiffstats
path: root/src/charon/plugins/ha_sync/ha_sync_ike.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/charon/plugins/ha_sync/ha_sync_ike.c')
-rw-r--r--src/charon/plugins/ha_sync/ha_sync_ike.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/charon/plugins/ha_sync/ha_sync_ike.c b/src/charon/plugins/ha_sync/ha_sync_ike.c
index 18033c824..dba3d0da2 100644
--- a/src/charon/plugins/ha_sync/ha_sync_ike.c
+++ b/src/charon/plugins/ha_sync/ha_sync_ike.c
@@ -31,6 +31,11 @@ struct private_ha_sync_ike_t {
* socket we use for syncing
*/
ha_sync_socket_t *socket;
+
+ /**
+ * tunnel securing sync messages
+ */
+ ha_sync_tunnel_t *tunnel;
};
/**
@@ -69,7 +74,7 @@ static bool ike_keys(private_ha_sync_ike_t *this, ike_sa_t *ike_sa,
proposal_t *proposal;
u_int16_t alg, len;
- if (this->socket->is_sync_sa(this->socket, ike_sa))
+ if (this->tunnel && this->tunnel->is_sync_sa(this->tunnel, ike_sa))
{ /* do not sync SA between nodes */
return TRUE;
}
@@ -131,7 +136,7 @@ static bool ike_state_change(private_ha_sync_ike_t *this, ike_sa_t *ike_sa,
{ /* only sync active IKE_SAs */
return TRUE;
}
- if (this->socket->is_sync_sa(this->socket, ike_sa))
+ if (this->tunnel && this->tunnel->is_sync_sa(this->tunnel, ike_sa))
{ /* do not sync SA between nodes */
return TRUE;
}
@@ -204,7 +209,7 @@ static bool ike_state_change(private_ha_sync_ike_t *this, ike_sa_t *ike_sa,
static bool message_hook(private_ha_sync_ike_t *this, ike_sa_t *ike_sa,
message_t *message, bool incoming)
{
- if (this->socket->is_sync_sa(this->socket, ike_sa))
+ if (this->tunnel && this->tunnel->is_sync_sa(this->tunnel, ike_sa))
{ /* do not sync SA between nodes */
return TRUE;
}
@@ -260,7 +265,8 @@ static void destroy(private_ha_sync_ike_t *this)
/**
* See header
*/
-ha_sync_ike_t *ha_sync_ike_create(ha_sync_socket_t *socket)
+ha_sync_ike_t *ha_sync_ike_create(ha_sync_socket_t *socket,
+ ha_sync_tunnel_t *tunnel)
{
private_ha_sync_ike_t *this = malloc_thing(private_ha_sync_ike_t);
@@ -271,6 +277,7 @@ ha_sync_ike_t *ha_sync_ike_create(ha_sync_socket_t *socket)
this->public.destroy = (void(*)(ha_sync_ike_t*))destroy;
this->socket = socket;
+ this->tunnel = tunnel;
return &this->public;
}