]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
ha: Fix build with DEBUG_LEVEL < 1
authorTobias Brunner <tobias@strongswan.org>
Mon, 1 May 2023 10:14:57 +0000 (12:14 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 8 May 2023 15:32:18 +0000 (17:32 +0200)
src/libcharon/plugins/ha/ha_child.c
src/libcharon/plugins/ha/ha_dispatcher.c

index 2485b49bbf3d6e8a44a329b7d48b17f505a06e3e..1081986dd1600a14b4d1928ab0aa83d1b6508d1d 100644 (file)
@@ -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);
index 3cf1aa67108c33192bcbf5b20a5ebda2bcb54a19..08a348b6133da96f6f45bcac592a831de62a8892 100644 (file)
@@ -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));