From: Tobias Brunner Date: Mon, 1 May 2023 09:59:46 +0000 (+0200) Subject: child-create: Fix build with DEBUG_LEVEL < 1 X-Git-Tag: 5.9.11rc1~12^2~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a883c4b37d6e8f1c562d853faedb61c3898c531;p=thirdparty%2Fstrongswan.git child-create: Fix build with DEBUG_LEVEL < 1 --- diff --git a/src/libcharon/sa/ikev2/tasks/child_create.c b/src/libcharon/sa/ikev2/tasks/child_create.c index daa56a9e5d..9282648209 100644 --- a/src/libcharon/sa/ikev2/tasks/child_create.c +++ b/src/libcharon/sa/ikev2/tasks/child_create.c @@ -495,7 +495,6 @@ static status_t select_and_install(private_child_create_t *this, bool no_dh, bool ike_auth) { status_t status, status_i, status_o; - child_sa_outbound_state_t out_state; chunk_t nonce_i, nonce_r; chunk_t encr_i = chunk_empty, encr_r = chunk_empty; chunk_t integ_i = chunk_empty, integ_r = chunk_empty; @@ -779,11 +778,14 @@ static status_t select_and_install(private_child_create_t *this, charon->bus->child_keys(charon->bus, this->child_sa, this->initiator, this->dh, nonce_i, nonce_r); +#if DEBUG_LEVEL >= 0 + child_sa_outbound_state_t out_state; + + out_state = this->child_sa->get_outbound_state(this->child_sa); my_ts = linked_list_create_from_enumerator( this->child_sa->create_ts_enumerator(this->child_sa, TRUE)); other_ts = linked_list_create_from_enumerator( this->child_sa->create_ts_enumerator(this->child_sa, FALSE)); - out_state = this->child_sa->get_outbound_state(this->child_sa); DBG0(DBG_IKE, "%sCHILD_SA %s{%d} established " "with SPIs %.8x_i %.8x_o and TS %#R === %#R", @@ -796,6 +798,7 @@ static status_t select_and_install(private_child_create_t *this, my_ts->destroy(my_ts); other_ts->destroy(other_ts); +#endif this->child_sa->set_state(this->child_sa, CHILD_INSTALLED); this->ike_sa->add_child_sa(this->ike_sa, this->child_sa); @@ -1129,13 +1132,13 @@ static bool check_for_generic_label(private_child_create_t *this) { if (generic_label_only(this)) { - sec_label_t *label; - - label = this->config->get_label(this->config); +#if DEBUG_LEVEL >= 1 + sec_label_t *label = this->config->get_label(this->config); DBG1(DBG_IKE, "not establishing CHILD_SA %s{%d} with generic " "label '%s'", this->child_sa->get_name(this->child_sa), this->child_sa->get_unique_id(this->child_sa), label->get_string(label)); +#endif return TRUE; } return FALSE;