diff options
author | Tobias Brunner <tobias@strongswan.org> | 2008-04-08 12:31:27 +0000 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2008-04-08 12:31:27 +0000 |
commit | 1d295d1ffa8cd3f13f7c2c6c8b7d74f484ff6ff4 (patch) | |
tree | 99185fceb414f216773ebcd9f8c048478d5b98e4 /src/charon/sa/connect_manager.c | |
parent | 6f186d7e2edfcf9f428a9bea58e78e8316a8527f (diff) | |
download | strongswan-1d295d1ffa8cd3f13f7c2c6c8b7d74f484ff6ff4.tar.bz2 strongswan-1d295d1ffa8cd3f13f7c2c6c8b7d74f484ff6ff4.tar.xz |
printing the checklist, two bugfixes
Diffstat (limited to 'src/charon/sa/connect_manager.c')
-rw-r--r-- | src/charon/sa/connect_manager.c | 26 |
1 files changed, 24 insertions, 2 deletions
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 @@ -690,6 +690,24 @@ static status_t get_triggered_pair(check_list_t *checklist, endpoint_pair_t **pa } /** + * 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); |