diff --git a/src/libcharon/config/child_cfg.c b/src/libcharon/config/child_cfg.c index 3e18a4af2..e1e2778a7 100644 --- a/src/libcharon/config/child_cfg.c +++ b/src/libcharon/config/child_cfg.c @@ -216,7 +216,7 @@ CALLBACK(match_proposal, bool, } METHOD(child_cfg_t, get_proposals, linked_list_t*, - private_child_cfg_t *this, bool strip_ke) + private_child_cfg_t *this, bool strip_ke, bool log) { enumerator_t *enumerator; proposal_t *current; @@ -241,8 +241,10 @@ METHOD(child_cfg_t, get_proposals, linked_list_t*, } enumerator->destroy(enumerator); - DBG2(DBG_CFG, "configured proposals: %#P", proposals); - + if (log) + { + DBG2(DBG_CFG, "configured proposals: %#P", proposals); + } return proposals; } diff --git a/src/libcharon/config/child_cfg.h b/src/libcharon/config/child_cfg.h index 258af040a..bdeebca4c 100644 --- a/src/libcharon/config/child_cfg.h +++ b/src/libcharon/config/child_cfg.h @@ -91,9 +91,10 @@ struct child_cfg_t { * Resulting list and all of its proposals must be freed after use. * * @param strip_ke TRUE strip out key exchange methods + * @param log whether to log the configured proposals * @return list of proposals */ - linked_list_t* (*get_proposals)(child_cfg_t *this, bool strip_ke); + linked_list_t* (*get_proposals)(child_cfg_t *this, bool strip_ke, bool log); /** * Select a proposal from a supplied list. diff --git a/src/libcharon/sa/ikev1/tasks/quick_mode.c b/src/libcharon/sa/ikev1/tasks/quick_mode.c index 8c06db523..bafe46af0 100644 --- a/src/libcharon/sa/ikev1/tasks/quick_mode.c +++ b/src/libcharon/sa/ikev1/tasks/quick_mode.c @@ -802,7 +802,7 @@ static linked_list_t *get_proposals(private_quick_mode_t *this, proposal_t *proposal; enumerator_t *enumerator; - list = this->config->get_proposals(this->config, FALSE); + list = this->config->get_proposals(this->config, FALSE, TRUE); enumerator = list->create_enumerator(list); while (enumerator->enumerate(enumerator, &proposal)) { @@ -864,7 +864,7 @@ METHOD(task_t, build_i, status_t, } } - list = this->config->get_proposals(this->config, FALSE); + list = this->config->get_proposals(this->config, FALSE, TRUE); if (list->get_first(list, (void**)&proposal) == SUCCESS) { this->proto = proposal->get_protocol(proposal); diff --git a/src/libcharon/sa/ikev2/tasks/child_create.c b/src/libcharon/sa/ikev2/tasks/child_create.c index 149808ee2..13ea7be47 100644 --- a/src/libcharon/sa/ikev2/tasks/child_create.c +++ b/src/libcharon/sa/ikev2/tasks/child_create.c @@ -1768,7 +1768,7 @@ METHOD(task_t, build_i, status_t, OPT_PER_CPU_SAS); } - this->proposals = this->config->get_proposals(this->config, no_ke); + this->proposals = this->config->get_proposals(this->config, no_ke, TRUE); this->mode = this->config->get_mode(this->config); this->child.if_id_in_def = this->ike_sa->get_if_id(this->ike_sa, TRUE); @@ -2486,7 +2486,7 @@ static void raise_alerts(private_child_create_t *this, notify_type_t type) switch (type) { case NO_PROPOSAL_CHOSEN: - list = this->config->get_proposals(this->config, FALSE); + list = this->config->get_proposals(this->config, FALSE, FALSE); charon->bus->alert(charon->bus, ALERT_PROPOSAL_MISMATCH_CHILD, list); list->destroy_offset(list, offsetof(proposal_t, destroy)); break; diff --git a/src/libcharon/sa/trap_manager.c b/src/libcharon/sa/trap_manager.c index 90a29b29b..9a4f08d07 100644 --- a/src/libcharon/sa/trap_manager.c +++ b/src/libcharon/sa/trap_manager.c @@ -219,7 +219,7 @@ static status_t install_trap(child_sa_t *child_sa, linked_list_t *local, /* we don't know the finally negotiated protocol (ESP|AH), we install * the SA with the protocol of the first proposal */ - proposals = child->get_proposals(child, TRUE); + proposals = child->get_proposals(child, TRUE, FALSE); if (proposals->get_first(proposals, (void**)&proposal) == SUCCESS) { proto = proposal->get_protocol(proposal);