diff options
author | Martin Willi <martin@revosec.ch> | 2012-01-20 12:23:46 +0100 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2012-03-20 17:31:38 +0100 |
commit | fed5c33440d609721cfdd5992f269c52a6191539 (patch) | |
tree | 5c94152924b42e8f0fb4690d9f6bbf1e54ce43d7 /src/libcharon/plugins/ha | |
parent | fd6fbf17640b2a999111d5bee1b7560b6e923815 (diff) | |
download | strongswan-fed5c33440d609721cfdd5992f269c52a6191539.tar.bz2 strongswan-fed5c33440d609721cfdd5992f269c52a6191539.tar.xz |
Synchronize IKEv1 DPD sequence numbers
Diffstat (limited to 'src/libcharon/plugins/ha')
-rw-r--r-- | src/libcharon/plugins/ha/ha_ike.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/libcharon/plugins/ha/ha_ike.c b/src/libcharon/plugins/ha/ha_ike.c index 09899a8f6..c8ad0f845 100644 --- a/src/libcharon/plugins/ha/ha_ike.c +++ b/src/libcharon/plugins/ha/ha_ike.c @@ -323,6 +323,36 @@ METHOD(listener_t, message_hook, bool, } } } + if (plain && ike_sa->get_version(ike_sa) == IKEV1 && + message->get_exchange_type(message) == INFORMATIONAL_V1) + { + ha_message_t *m; + notify_payload_t *notify; + chunk_t data; + u_int32_t seq; + + notify = message->get_notify(message, DPD_R_U_THERE); + if (notify) + { + data = notify->get_notification_data(notify); + if (data.len == 4) + { + seq = untoh32(data.ptr); + if (incoming) + { + m = ha_message_create(HA_IKE_MID_RESPONDER); + } + else + { + m = ha_message_create(HA_IKE_MID_INITIATOR); + } + m->add_attribute(m, HA_IKE_ID, ike_sa->get_id(ike_sa)); + m->add_attribute(m, HA_MID, seq + 1); + this->socket->push(this->socket, m); + this->cache->cache(this->cache, ike_sa, m); + } + } + } return TRUE; } |