Log peer cfg enumeration externally for flexibility
authorMartin Willi <martin@revosec.ch>
Mon, 12 Dec 2011 11:30:47 +0000 (12:30 +0100)
committerMartin Willi <martin@revosec.ch>
Tue, 20 Mar 2012 16:31:17 +0000 (17:31 +0100)
src/libcharon/config/backend_manager.c
src/libcharon/sa/tasks/ike_auth.c
src/libcharon/sa/tasks/main_mode.c

index c84da25..5fe137e 100644 (file)
@@ -347,9 +347,6 @@ METHOD(backend_manager_t, create_peer_cfg_enumerator, enumerator_t*,
                return enumerator;
        }
 
-       DBG1(DBG_CFG, "looking for peer configs matching %H[%Y]...%H[%Y]",
-                me, my_id, other, other_id);
-
        configs = linked_list_create();
        /* only once allocated helper list for sorting */
        helper = linked_list_create();
index 4a92385..39d865c 100644 (file)
@@ -269,6 +269,8 @@ static bool load_cfg_candidates(private_ike_auth_t *this)
        my_id = this->ike_sa->get_my_id(this->ike_sa);
        other_id = this->ike_sa->get_other_id(this->ike_sa);
 
+       DBG1(DBG_CFG, "looking for peer configs matching %H[%Y]...%H[%Y]",
+                me, my_id, other, other_id);
        enumerator = charon->backends->create_peer_cfg_enumerator(charon->backends,
                                                                                                        me, other, my_id, other_id);
        while (enumerator->enumerate(enumerator, &peer_cfg))
index dbdc0c0..240f7f3 100755 (executable)
@@ -334,10 +334,13 @@ static peer_cfg_t *select_config(private_main_mode_t *this, identification_t *id
 {
        enumerator_t *enumerator;
        peer_cfg_t *current, *found = NULL;
+       host_t *me, *other;
 
+       me = this->ike_sa->get_my_host(this->ike_sa);
+       other = this->ike_sa->get_other_host(this->ike_sa);
+       DBG1(DBG_CFG, "looking for peer configs matching %H...%H[%Y]", me, other, id);
        enumerator = charon->backends->create_peer_cfg_enumerator(charon->backends,
-                                               this->ike_sa->get_my_host(this->ike_sa),
-                                               this->ike_sa->get_other_host(this->ike_sa), NULL, id);
+                                                                                                               me, other, NULL, id);
        while (enumerator->enumerate(enumerator, &current))
        {
                if (get_auth_method(this, current) == this->auth_method)