fixed crash due to missing function call parameter
This commit is contained in:
@@ -276,6 +276,7 @@ struct private_ike_sa_manager_t {
|
|||||||
static void lock_single_segment(private_ike_sa_manager_t *this, u_int index)
|
static void lock_single_segment(private_ike_sa_manager_t *this, u_int index)
|
||||||
{
|
{
|
||||||
mutex_t *lock = this->segments[index & this->segment_mask].mutex;
|
mutex_t *lock = this->segments[index & this->segment_mask].mutex;
|
||||||
|
|
||||||
lock->lock(lock);
|
lock->lock(lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -286,6 +287,7 @@ static void lock_single_segment(private_ike_sa_manager_t *this, u_int index)
|
|||||||
static void unlock_single_segment(private_ike_sa_manager_t *this, u_int index)
|
static void unlock_single_segment(private_ike_sa_manager_t *this, u_int index)
|
||||||
{
|
{
|
||||||
mutex_t *lock = this->segments[index & this->segment_mask].mutex;
|
mutex_t *lock = this->segments[index & this->segment_mask].mutex;
|
||||||
|
|
||||||
lock->unlock(lock);
|
lock->unlock(lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -295,6 +297,7 @@ static void unlock_single_segment(private_ike_sa_manager_t *this, u_int index)
|
|||||||
static void lock_all_segments(private_ike_sa_manager_t *this)
|
static void lock_all_segments(private_ike_sa_manager_t *this)
|
||||||
{
|
{
|
||||||
u_int i;
|
u_int i;
|
||||||
|
|
||||||
for (i = 0; i < this->segment_count; ++i)
|
for (i = 0; i < this->segment_count; ++i)
|
||||||
{
|
{
|
||||||
this->segments[i].mutex->lock(this->segments[i].mutex);
|
this->segments[i].mutex->lock(this->segments[i].mutex);
|
||||||
@@ -307,6 +310,7 @@ static void lock_all_segments(private_ike_sa_manager_t *this)
|
|||||||
static void unlock_all_segments(private_ike_sa_manager_t *this)
|
static void unlock_all_segments(private_ike_sa_manager_t *this)
|
||||||
{
|
{
|
||||||
u_int i;
|
u_int i;
|
||||||
|
|
||||||
for (i = 0; i < this->segment_count; ++i)
|
for (i = 0; i < this->segment_count; ++i)
|
||||||
{
|
{
|
||||||
this->segments[i].mutex->unlock(this->segments[i].mutex);
|
this->segments[i].mutex->unlock(this->segments[i].mutex);
|
||||||
@@ -358,6 +362,7 @@ static bool enumerate(private_enumerator_t *this, entry_t **entry, u_int *segmen
|
|||||||
if (this->current)
|
if (this->current)
|
||||||
{
|
{
|
||||||
entry_t *item;
|
entry_t *item;
|
||||||
|
|
||||||
if (this->current->enumerate(this->current, (void**)&item))
|
if (this->current->enumerate(this->current, (void**)&item))
|
||||||
{
|
{
|
||||||
*entry = item;
|
*entry = item;
|
||||||
@@ -371,6 +376,7 @@ static bool enumerate(private_enumerator_t *this, entry_t **entry, u_int *segmen
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
linked_list_t *list;
|
linked_list_t *list;
|
||||||
|
|
||||||
lock_single_segment(this->manager, this->segment);
|
lock_single_segment(this->manager, this->segment);
|
||||||
if ((list = this->manager->ike_sa_table[this->row]) != NULL &&
|
if ((list = this->manager->ike_sa_table[this->row]) != NULL &&
|
||||||
list->get_count(list))
|
list->get_count(list))
|
||||||
@@ -451,6 +457,7 @@ static void remove_entry(private_ike_sa_manager_t *this, entry_t *entry)
|
|||||||
if ((list = this->ike_sa_table[row]) != NULL)
|
if ((list = this->ike_sa_table[row]) != NULL)
|
||||||
{
|
{
|
||||||
entry_t *current;
|
entry_t *current;
|
||||||
|
|
||||||
enumerator_t *enumerator = list->create_enumerator(list);
|
enumerator_t *enumerator = list->create_enumerator(list);
|
||||||
while (enumerator->enumerate(enumerator, ¤t))
|
while (enumerator->enumerate(enumerator, ¤t))
|
||||||
{
|
{
|
||||||
@@ -643,6 +650,7 @@ static ike_sa_t* checkout_by_message(private_ike_sa_manager_t* this,
|
|||||||
entry_t *entry;
|
entry_t *entry;
|
||||||
ike_sa_t *ike_sa = NULL;
|
ike_sa_t *ike_sa = NULL;
|
||||||
ike_sa_id_t *id = message->get_ike_sa_id(message);
|
ike_sa_id_t *id = message->get_ike_sa_id(message);
|
||||||
|
|
||||||
id = id->clone(id);
|
id = id->clone(id);
|
||||||
id->switch_initiator(id);
|
id->switch_initiator(id);
|
||||||
|
|
||||||
@@ -1138,10 +1146,11 @@ static int get_half_open_count(private_ike_sa_manager_t *this, host_t *ip)
|
|||||||
{
|
{
|
||||||
enumerator_t *enumerator;
|
enumerator_t *enumerator;
|
||||||
entry_t *entry;
|
entry_t *entry;
|
||||||
|
u_int segment;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
enumerator = create_table_enumerator(this);
|
enumerator = create_table_enumerator(this);
|
||||||
while (enumerator->enumerate(enumerator, &entry))
|
while (enumerator->enumerate(enumerator, &entry, &segment))
|
||||||
{
|
{
|
||||||
/* we check if we have a responder CONNECTING IKE_SA without checkout */
|
/* we check if we have a responder CONNECTING IKE_SA without checkout */
|
||||||
if (!entry->ike_sa_id->is_initiator(entry->ike_sa_id) &&
|
if (!entry->ike_sa_id->is_initiator(entry->ike_sa_id) &&
|
||||||
@@ -1232,9 +1241,11 @@ static void flush(private_ike_sa_manager_t *this)
|
|||||||
static void destroy(private_ike_sa_manager_t *this)
|
static void destroy(private_ike_sa_manager_t *this)
|
||||||
{
|
{
|
||||||
u_int i;
|
u_int i;
|
||||||
|
|
||||||
for (i = 0; i < this->table_size; ++i)
|
for (i = 0; i < this->table_size; ++i)
|
||||||
{
|
{
|
||||||
linked_list_t *list;
|
linked_list_t *list;
|
||||||
|
|
||||||
if ((list = this->ike_sa_table[i]) != NULL)
|
if ((list = this->ike_sa_table[i]) != NULL)
|
||||||
{
|
{
|
||||||
list->destroy(list);
|
list->destroy(list);
|
||||||
@@ -1260,6 +1271,7 @@ static void destroy(private_ike_sa_manager_t *this)
|
|||||||
static u_int get_nearest_powerof2(u_int n)
|
static u_int get_nearest_powerof2(u_int n)
|
||||||
{
|
{
|
||||||
u_int i;
|
u_int i;
|
||||||
|
|
||||||
--n;
|
--n;
|
||||||
for (i = 1; i < sizeof(u_int) * 8; i <<= 1)
|
for (i = 1; i < sizeof(u_int) * 8; i <<= 1)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user