ike: Consistently log CHILD_SAs with their unique_id instead of their reqid
authorMartin Willi <martin@revosec.ch>
Tue, 28 Oct 2014 09:54:38 +0000 (10:54 +0100)
committerMartin Willi <martin@revosec.ch>
Fri, 20 Feb 2015 12:34:52 +0000 (13:34 +0100)
src/frontends/android/jni/libandroidbridge/backend/android_service.c
src/libcharon/plugins/ha/ha_child.c
src/libcharon/plugins/ha/ha_dispatcher.c
src/libcharon/sa/ikev1/task_manager_v1.c
src/libcharon/sa/ikev1/tasks/quick_delete.c
src/libcharon/sa/ikev1/tasks/quick_mode.c
src/libcharon/sa/ikev2/tasks/child_create.c
src/libcharon/sa/ikev2/tasks/child_delete.c

index 64a7907..896bb09 100644 (file)
@@ -285,7 +285,7 @@ static bool setup_tun_device(private_android_service_t *this,
        int tunfd;
 
        DBG1(DBG_DMN, "setting up TUN device for CHILD_SA %s{%u}",
-                child_sa->get_name(child_sa), child_sa->get_reqid(child_sa));
+                child_sa->get_name(child_sa), child_sa->get_unique_id(child_sa));
 
        builder = charonservice->get_vpnservice_builder(charonservice);
 
index c166d72..ed6ca71 100644 (file)
@@ -128,7 +128,7 @@ METHOD(listener_t, child_keys, bool,
                        ike_sa->get_other_host(ike_sa), child_sa->get_spi(child_sa, FALSE));
        DBG1(DBG_CFG, "handling HA CHILD_SA %s{%d} %#R=== %#R "
                "(segment in: %d%s, out: %d%s)", child_sa->get_name(child_sa),
-               child_sa->get_reqid(child_sa), local_ts, remote_ts,
+               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) ? "*" : "");
 
index 6e02733..983f9d8 100644 (file)
@@ -836,7 +836,7 @@ static void process_child_add(private_ha_dispatcher_t *this,
 
        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_reqid(child_sa), local_ts, remote_ts,
+               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) ? "*" : "");
        child_sa->add_policies(child_sa, local_ts, remote_ts);
index 3184db4..cb22bf6 100644 (file)
@@ -1596,7 +1596,8 @@ static bool is_redundant(private_task_manager_t *this, child_sa_t *child_sa)
                                child_sa->get_lifetime(child_sa, FALSE))
                {
                        DBG1(DBG_IKE, "deleting redundant CHILD_SA %s{%d}",
-                                child_sa->get_name(child_sa), child_sa->get_reqid(child_sa));
+                                child_sa->get_name(child_sa),
+                                child_sa->get_unique_id(child_sa));
                        redundant = TRUE;
                        break;
                }
index 499081c..4206182 100644 (file)
@@ -116,7 +116,7 @@ static bool delete_child(private_quick_delete_t *this, protocol_id_t protocol,
        {
                DBG0(DBG_IKE, "closing expired CHILD_SA %s{%d} "
                         "with SPIs %.8x_i %.8x_o and TS %#R=== %#R",
-                        child_sa->get_name(child_sa), child_sa->get_reqid(child_sa),
+                        child_sa->get_name(child_sa), child_sa->get_unique_id(child_sa),
                         ntohl(child_sa->get_spi(child_sa, TRUE)),
                         ntohl(child_sa->get_spi(child_sa, FALSE)), my_ts, other_ts);
        }
@@ -127,7 +127,7 @@ static bool delete_child(private_quick_delete_t *this, protocol_id_t protocol,
 
                DBG0(DBG_IKE, "closing CHILD_SA %s{%d} with SPIs "
                         "%.8x_i (%llu bytes) %.8x_o (%llu bytes) and TS %#R=== %#R",
-                        child_sa->get_name(child_sa), child_sa->get_reqid(child_sa),
+                        child_sa->get_name(child_sa), child_sa->get_unique_id(child_sa),
                         ntohl(child_sa->get_spi(child_sa, TRUE)), bytes_in,
                         ntohl(child_sa->get_spi(child_sa, FALSE)), bytes_out,
                         my_ts, other_ts);
index 8ca3ac7..828b166 100644 (file)
@@ -385,7 +385,7 @@ static bool install(private_quick_mode_t *this)
        DBG0(DBG_IKE, "CHILD_SA %s{%d} established "
                 "with SPIs %.8x_i %.8x_o and TS %#R=== %#R",
                 this->child_sa->get_name(this->child_sa),
-                this->child_sa->get_reqid(this->child_sa),
+                this->child_sa->get_unique_id(this->child_sa),
                 ntohl(this->child_sa->get_spi(this->child_sa, TRUE)),
                 ntohl(this->child_sa->get_spi(this->child_sa, FALSE)), my_ts, other_ts);
 
@@ -986,7 +986,8 @@ static void check_for_rekeyed_child(private_quick_mode_t *this)
                                                                                                                        FALSE).value;
                                                child_sa->set_state(child_sa, CHILD_REKEYING);
                                                DBG1(DBG_IKE, "detected rekeying of CHILD_SA %s{%u}",
-                                                        child_sa->get_name(child_sa), this->reqid);
+                                                        child_sa->get_name(child_sa),
+                                                        child_sa->get_unique_id(child_sa));
                                        }
                                        policies->destroy(policies);
                                break;
index abee0da..1bb9340 100644 (file)
@@ -703,7 +703,7 @@ static status_t select_and_install(private_child_create_t *this,
        DBG0(DBG_IKE, "CHILD_SA %s{%d} established "
                 "with SPIs %.8x_i %.8x_o and TS %#R=== %#R",
                 this->child_sa->get_name(this->child_sa),
-                this->child_sa->get_reqid(this->child_sa),
+                this->child_sa->get_unique_id(this->child_sa),
                 ntohl(this->child_sa->get_spi(this->child_sa, TRUE)),
                 ntohl(this->child_sa->get_spi(this->child_sa, FALSE)), my_ts, other_ts);
 
index 2b16974..f0b11e2 100644 (file)
@@ -267,7 +267,7 @@ static void log_children(private_child_delete_t *this)
                {
                        DBG0(DBG_IKE, "closing expired CHILD_SA %s{%d} "
                                 "with SPIs %.8x_i %.8x_o and TS %#R=== %#R",
-                                child_sa->get_name(child_sa), child_sa->get_reqid(child_sa),
+                                child_sa->get_name(child_sa), child_sa->get_unique_id(child_sa),
                                 ntohl(child_sa->get_spi(child_sa, TRUE)),
                                 ntohl(child_sa->get_spi(child_sa, FALSE)), my_ts, other_ts);
                }
@@ -278,7 +278,7 @@ static void log_children(private_child_delete_t *this)
 
                        DBG0(DBG_IKE, "closing CHILD_SA %s{%d} with SPIs %.8x_i "
                                 "(%llu bytes) %.8x_o (%llu bytes) and TS %#R=== %#R",
-                                child_sa->get_name(child_sa), child_sa->get_reqid(child_sa),
+                                child_sa->get_name(child_sa), child_sa->get_unique_id(child_sa),
                                 ntohl(child_sa->get_spi(child_sa, TRUE)), bytes_in,
                                 ntohl(child_sa->get_spi(child_sa, FALSE)), bytes_out,
                                 my_ts, other_ts);