From 1d295d1ffa8cd3f13f7c2c6c8b7d74f484ff6ff4 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Tue, 8 Apr 2008 12:31:27 +0000 Subject: printing the checklist, two bugfixes --- src/charon/sa/connect_manager.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/charon/sa/connect_manager.c b/src/charon/sa/connect_manager.c index c391577fc..b0d6a99c3 100644 --- a/src/charon/sa/connect_manager.c +++ b/src/charon/sa/connect_manager.c @@ -689,6 +689,24 @@ static status_t get_triggered_pair(check_list_t *checklist, endpoint_pair_t **pa return status; } +/** + * Prints all the pairs on a checklist + */ +static void print_checklist(check_list_t *checklist) +{ + iterator_t *iterator; + endpoint_pair_t *current; + + DBG1(DBG_IKE, "pairs on checklist %#B:", &checklist->connect_id); + iterator = checklist->pairs->create_iterator(checklist->pairs, TRUE); + while (iterator->iterate(iterator, (void**)¤t)) + { + DBG1(DBG_IKE, " * %#H - %#H (%d)", current->local, current->remote, + current->priority); + } + iterator->destroy(iterator); +} + /** * Prunes identical pairs with lower priority from the list * Note: this function also numbers the remaining pairs serially @@ -719,7 +737,7 @@ static void prune_pairs(linked_list_t *pairs) * order, and we iterate the list from the beginning, we are * sure that the priority of 'other' is lower than that of * 'current', remove it */ - DBG1(DBG_IKE, "pruning endpoint pair %H - %H with priority %d", + DBG1(DBG_IKE, "pruning endpoint pair %#H - %#H with priority %d", other->local, other->remote, other->priority); search->remove(search); endpoint_pair_destroy(other); @@ -756,6 +774,8 @@ static void build_pairs(check_list_t *checklist) iterator_r->destroy(iterator_r); } iterator_i->destroy(iterator_i); + + print_checklist(checklist); prune_pairs(checklist->pairs); } @@ -1072,6 +1092,7 @@ static void send_check(private_connect_manager_t *this, check_list_t *checklist, { DESTROY_IF(pair->packet); pair->packet = packet; + pair->retransmitted = 0; queue_retransmission(this, checklist, pair); } else @@ -1088,10 +1109,11 @@ static void send_check(private_connect_manager_t *this, check_list_t *checklist, static void queue_triggered_check(private_connect_manager_t *this, check_list_t *checklist, endpoint_pair_t *pair) { + DBG2(DBG_IKE, "queueing triggered check for pair '%d'", pair->id); pair->state = CHECK_WAITING; checklist->triggered->insert_last(checklist->triggered, pair); - if (checklist->sender) + if (!checklist->sender) { /* if the sender is not running we restart it */ schedule_checks(this, checklist, ME_INTERVAL); -- cgit v1.2.3