Remove entry from active duplicate list only if it was not in checking

This commit is contained in:
Martin Willi
2011-02-28 15:37:18 +00:00
parent ee0f53e189
commit b85be69079
@@ -137,11 +137,6 @@ METHOD(listener_t, ike_updown, bool,
else
{
this->mutex->lock(this->mutex);
entry = this->active->remove(this->active, id);
if (entry)
{
entry_destroy(entry);
}
entry = this->checking->remove(this->checking, id);
this->mutex->unlock(this->mutex);
if (entry)
@@ -150,6 +145,16 @@ METHOD(listener_t, ike_updown, bool,
"keeping new IKE_SA", id);
entry_destroy(entry);
}
else
{
this->mutex->lock(this->mutex);
entry = this->active->remove(this->active, id);
this->mutex->unlock(this->mutex);
if (entry)
{
entry_destroy(entry);
}
}
}
return TRUE;
}