From: Tobias Brunner Date: Mon, 1 May 2023 10:14:57 +0000 (+0200) Subject: ha: Fix build with DEBUG_LEVEL < 1 X-Git-Tag: 5.9.11rc1~12^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0ce4ef8db5aca17ecd86aa4f4fbc63b80dd501e;p=thirdparty%2Fstrongswan.git ha: Fix build with DEBUG_LEVEL < 1 --- diff --git a/src/libcharon/plugins/ha/ha_child.c b/src/libcharon/plugins/ha/ha_child.c index 2485b49bbf..1081986dd1 100644 --- a/src/libcharon/plugins/ha/ha_child.c +++ b/src/libcharon/plugins/ha/ha_child.c @@ -60,7 +60,6 @@ METHOD(listener_t, child_keys, bool, linked_list_t *local_ts, *remote_ts; enumerator_t *enumerator; traffic_selector_t *ts; - u_int seg_i, seg_o; if (this->tunnel && this->tunnel->is_sa(this->tunnel, ike_sa)) { /* do not sync SA between nodes */ @@ -127,6 +126,9 @@ METHOD(listener_t, child_keys, bool, } enumerator->destroy(enumerator); +#if DEBUG_LEVEL >= 1 + u_int seg_i, seg_o; + seg_i = this->kernel->get_segment_spi(this->kernel, ike_sa->get_my_host(ike_sa), child_sa->get_spi(child_sa, TRUE)); seg_o = this->kernel->get_segment_spi(this->kernel, @@ -136,6 +138,7 @@ METHOD(listener_t, child_keys, bool, child_sa->get_unique_id(child_sa), local_ts, remote_ts, seg_i, this->segments->is_active(this->segments, seg_i) ? "*" : "", seg_o, this->segments->is_active(this->segments, seg_o) ? "*" : ""); +#endif /* DEBUG_LEVEL */ local_ts->destroy(local_ts); remote_ts->destroy(remote_ts); diff --git a/src/libcharon/plugins/ha/ha_dispatcher.c b/src/libcharon/plugins/ha/ha_dispatcher.c index 3cf1aa6710..08a348b613 100644 --- a/src/libcharon/plugins/ha/ha_dispatcher.c +++ b/src/libcharon/plugins/ha/ha_dispatcher.c @@ -658,7 +658,6 @@ static void process_child_add(private_ha_dispatcher_t *this, uint8_t mode = MODE_TUNNEL, ipcomp = 0; uint16_t encr = 0, integ = 0, len = 0, dh_grp = 0; uint16_t esn = NO_EXT_SEQ_NUMBERS; - u_int seg_i, seg_o; chunk_t nonce_i = chunk_empty, nonce_r = chunk_empty, secret = chunk_empty; chunk_t encr_i, integ_i, encr_r, integ_r; linked_list_t *local_ts, *remote_ts; @@ -858,16 +857,20 @@ static void process_child_add(private_ha_dispatcher_t *this, return; } +#if DEBUG_LEVEL >= 1 + u_int seg_i, seg_o; + seg_i = this->kernel->get_segment_spi(this->kernel, ike_sa->get_my_host(ike_sa), inbound_spi); seg_o = this->kernel->get_segment_spi(this->kernel, ike_sa->get_other_host(ike_sa), outbound_spi); - DBG1(DBG_CFG, "installed HA CHILD_SA %s{%d} %#R === %#R " "(segment in: %d%s, out: %d%s)", child_sa->get_name(child_sa), child_sa->get_unique_id(child_sa), local_ts, remote_ts, seg_i, this->segments->is_active(this->segments, seg_i) ? "*" : "", seg_o, this->segments->is_active(this->segments, seg_o) ? "*" : ""); +#endif /* DEBUG_LEVEL */ + child_sa->install_policies(child_sa); local_ts->destroy_offset(local_ts, offsetof(traffic_selector_t, destroy)); remote_ts->destroy_offset(remote_ts, offsetof(traffic_selector_t, destroy));