diff options
author | Clavister OpenSource <opensource@clavister.com> | 2011-12-09 11:41:26 +0100 |
---|---|---|
committer | Clavister OpenSource <opensource@clavister.com> | 2012-03-20 17:31:14 +0100 |
commit | a064eaa8a63a7ed2b3d8b5f0807d791d9ed89f5c (patch) | |
tree | 3702cfaa4cf74b8192aad59133062d632b660610 /src/libcharon/sa/ike_sa_manager.c | |
parent | 751bd02e98a8802139755c58148f9e5da14ce143 (diff) | |
download | strongswan-a064eaa8a63a7ed2b3d8b5f0807d791d9ed89f5c.tar.bz2 strongswan-a064eaa8a63a7ed2b3d8b5f0807d791d9ed89f5c.tar.xz |
Handling of initial contact
Diffstat (limited to 'src/libcharon/sa/ike_sa_manager.c')
-rwxr-xr-x[-rw-r--r--] | src/libcharon/sa/ike_sa_manager.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libcharon/sa/ike_sa_manager.c b/src/libcharon/sa/ike_sa_manager.c index ffbc2ec3b..776b2b7ae 100644..100755 --- a/src/libcharon/sa/ike_sa_manager.c +++ b/src/libcharon/sa/ike_sa_manager.c @@ -1358,6 +1358,17 @@ METHOD(ike_sa_manager_t, checkin, void, if (ike_sa->get_state(ike_sa) == IKE_ESTABLISHED && entry->my_id == NULL && entry->other_id == NULL) { + if (ike_sa->get_version(ike_sa) == IKEV1) + { + /* If authenticated and received INITIAL_CONTACT, + * delete any existing IKE_SAs with that peer. */ + if (ike_sa->has_condition(ike_sa, COND_INIT_CONTACT_SEEN)) + { + this->public.check_uniqueness(&this->public, ike_sa, TRUE); + ike_sa->set_condition(ike_sa, COND_INIT_CONTACT_SEEN, FALSE); + } + } + entry->my_id = my_id->clone(my_id); entry->other_id = other_id->clone(other_id); if (!entry->other) |