ike: Use correct format string for unique IKE SA identifiers
Would take a while until it became an issue, though.
This commit is contained in:
@@ -211,7 +211,7 @@ static void enable_disable(private_ha_segments_t *this, u_int segment,
|
||||
unique_id);
|
||||
if (ike_sa)
|
||||
{
|
||||
DBG1(DBG_IKE, "destroying incomplete IKE_SA %s[%d] after "
|
||||
DBG1(DBG_IKE, "destroying incomplete IKE_SA %s[%u] after "
|
||||
"%sactivating HA segment %d", ike_sa->get_name(ike_sa),
|
||||
unique_id, enable ? "" : "de", segment);
|
||||
charon->ike_sa_manager->checkin_and_destroy(charon->ike_sa_manager,
|
||||
|
||||
@@ -79,7 +79,7 @@ static void log_task_q(FILE *out, ike_sa_t *ike_sa, task_queue_t q, char *name)
|
||||
{
|
||||
if (!has)
|
||||
{
|
||||
fprintf(out, "%12s[%d]: Tasks %s: ", ike_sa->get_name(ike_sa),
|
||||
fprintf(out, "%12s[%u]: Tasks %s: ", ike_sa->get_name(ike_sa),
|
||||
ike_sa->get_unique_id(ike_sa), name);
|
||||
has = TRUE;
|
||||
}
|
||||
@@ -100,7 +100,7 @@ static void log_ike_sa(FILE *out, ike_sa_t *ike_sa, bool all)
|
||||
ike_sa_id_t *id = ike_sa->get_id(ike_sa);
|
||||
time_t now = time_monotonic(NULL);
|
||||
|
||||
fprintf(out, "%12s[%d]: %N",
|
||||
fprintf(out, "%12s[%u]: %N",
|
||||
ike_sa->get_name(ike_sa), ike_sa->get_unique_id(ike_sa),
|
||||
ike_sa_state_names, ike_sa->get_state(ike_sa));
|
||||
|
||||
@@ -125,7 +125,7 @@ static void log_ike_sa(FILE *out, ike_sa_t *ike_sa, bool all)
|
||||
|
||||
if (!eap_id->equals(eap_id, ike_sa->get_other_id(ike_sa)))
|
||||
{
|
||||
fprintf(out, "%12s[%d]: Remote %s identity: %Y\n",
|
||||
fprintf(out, "%12s[%u]: Remote %s identity: %Y\n",
|
||||
ike_sa->get_name(ike_sa), ike_sa->get_unique_id(ike_sa),
|
||||
ike_sa->get_version(ike_sa) == IKEV1 ? "XAuth" : "EAP",
|
||||
eap_id);
|
||||
@@ -133,7 +133,7 @@ static void log_ike_sa(FILE *out, ike_sa_t *ike_sa, bool all)
|
||||
|
||||
ike_proposal = ike_sa->get_proposal(ike_sa);
|
||||
|
||||
fprintf(out, "%12s[%d]: %N SPIs: %.16"PRIx64"_i%s %.16"PRIx64"_r%s",
|
||||
fprintf(out, "%12s[%u]: %N SPIs: %.16"PRIx64"_i%s %.16"PRIx64"_r%s",
|
||||
ike_sa->get_name(ike_sa), ike_sa->get_unique_id(ike_sa),
|
||||
ike_version_names, ike_sa->get_version(ike_sa),
|
||||
be64toh(id->get_initiator_spi(id)),
|
||||
@@ -188,7 +188,7 @@ static void log_ike_sa(FILE *out, ike_sa_t *ike_sa, bool all)
|
||||
char buf[BUF_LEN];
|
||||
|
||||
snprintf(buf, BUF_LEN, "%P", ike_proposal);
|
||||
fprintf(out, "%12s[%d]: IKE proposal: %s\n",
|
||||
fprintf(out, "%12s[%u]: IKE proposal: %s\n",
|
||||
ike_sa->get_name(ike_sa), ike_sa->get_unique_id(ike_sa),
|
||||
buf+4);
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ static job_requeue_t check_systime(private_systime_fix_plugin_t *this)
|
||||
job = &delete_ike_sa_job_create(ike_sa->get_id(ike_sa),
|
||||
TRUE)->job_interface;
|
||||
}
|
||||
DBG1(DBG_CFG, "%s[%d] has certificates not valid, %s IKE_SA",
|
||||
DBG1(DBG_CFG, "%s[%u] has certificates not valid, %s IKE_SA",
|
||||
ike_sa->get_name(ike_sa), ike_sa->get_unique_id(ike_sa),
|
||||
action);
|
||||
lib->processor->queue_job(lib->processor, job);
|
||||
|
||||
@@ -907,7 +907,7 @@ METHOD(ike_sa_t, set_state, void,
|
||||
{
|
||||
bool trigger_dpd = FALSE, keepalives = FALSE;
|
||||
|
||||
DBG2(DBG_IKE, "IKE_SA %s[%d] state change: %N => %N",
|
||||
DBG2(DBG_IKE, "IKE_SA %s[%u] state change: %N => %N",
|
||||
get_name(this), this->unique_id,
|
||||
ike_sa_state_names, this->state,
|
||||
ike_sa_state_names, state);
|
||||
@@ -2021,7 +2021,7 @@ METHOD(ike_sa_t, reauth, status_t,
|
||||
}
|
||||
if (this->state == IKE_CONNECTING)
|
||||
{
|
||||
DBG0(DBG_IKE, "reinitiating IKE_SA %s[%d]",
|
||||
DBG0(DBG_IKE, "reinitiating IKE_SA %s[%u]",
|
||||
get_name(this), this->unique_id);
|
||||
reset(this, TRUE);
|
||||
return this->task_manager->initiate(this->task_manager);
|
||||
@@ -2036,12 +2036,12 @@ METHOD(ike_sa_t, reauth, status_t,
|
||||
time_t del = this->stats[STAT_DELETE];
|
||||
time_t now = time_monotonic(NULL);
|
||||
DBG1(DBG_IKE, "initiator did not reauthenticate as requested, IKE_SA "
|
||||
"%s[%d] will timeout in %V", get_name(this), this->unique_id,
|
||||
"%s[%u] will timeout in %V", get_name(this), this->unique_id,
|
||||
&now, &del);
|
||||
#endif
|
||||
return FAILED;
|
||||
}
|
||||
DBG0(DBG_IKE, "reauthenticating IKE_SA %s[%d]",
|
||||
DBG0(DBG_IKE, "reauthenticating IKE_SA %s[%u]",
|
||||
get_name(this), this->unique_id);
|
||||
set_condition(this, COND_REAUTHENTICATING, TRUE);
|
||||
this->task_manager->queue_ike_reauth(this->task_manager);
|
||||
|
||||
@@ -101,7 +101,7 @@ static bool establish(private_aggressive_mode_t *this)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
DBG0(DBG_IKE, "IKE_SA %s[%d] established between %H[%Y]...%H[%Y]",
|
||||
DBG0(DBG_IKE, "IKE_SA %s[%u] established between %H[%Y]...%H[%Y]",
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa),
|
||||
this->ike_sa->get_my_host(this->ike_sa),
|
||||
@@ -216,7 +216,7 @@ METHOD(task_t, build_i, status_t,
|
||||
packet_t *packet;
|
||||
uint16_t group;
|
||||
|
||||
DBG0(DBG_IKE, "initiating Aggressive Mode IKE_SA %s[%d] to %H",
|
||||
DBG0(DBG_IKE, "initiating Aggressive Mode IKE_SA %s[%u] to %H",
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa),
|
||||
this->ike_sa->get_other_host(this->ike_sa));
|
||||
|
||||
@@ -44,7 +44,7 @@ METHOD(task_t, build_i, status_t,
|
||||
delete_payload_t *delete_payload;
|
||||
ike_sa_id_t *id;
|
||||
|
||||
DBG0(DBG_IKE, "deleting IKE_SA %s[%d] between %H[%Y]...%H[%Y]",
|
||||
DBG0(DBG_IKE, "deleting IKE_SA %s[%u] between %H[%Y]...%H[%Y]",
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa),
|
||||
this->ike_sa->get_my_host(this->ike_sa),
|
||||
@@ -58,7 +58,7 @@ METHOD(task_t, build_i, status_t,
|
||||
id->get_responder_spi(id));
|
||||
message->add_payload(message, (payload_t*)delete_payload);
|
||||
|
||||
DBG1(DBG_IKE, "sending DELETE for IKE_SA %s[%d]",
|
||||
DBG1(DBG_IKE, "sending DELETE for IKE_SA %s[%u]",
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa));
|
||||
|
||||
@@ -112,10 +112,10 @@ METHOD(task_t, process_r, status_t,
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
DBG1(DBG_IKE, "received DELETE for IKE_SA %s[%d]",
|
||||
DBG1(DBG_IKE, "received DELETE for IKE_SA %s[%u]",
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa));
|
||||
DBG0(DBG_IKE, "deleting IKE_SA %s[%d] between %H[%Y]...%H[%Y]",
|
||||
DBG0(DBG_IKE, "deleting IKE_SA %s[%u] between %H[%Y]...%H[%Y]",
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa),
|
||||
this->ike_sa->get_my_host(this->ike_sa),
|
||||
|
||||
@@ -98,7 +98,7 @@ static bool establish(private_main_mode_t *this)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
DBG0(DBG_IKE, "IKE_SA %s[%d] established between %H[%Y]...%H[%Y]",
|
||||
DBG0(DBG_IKE, "IKE_SA %s[%u] established between %H[%Y]...%H[%Y]",
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa),
|
||||
this->ike_sa->get_my_host(this->ike_sa),
|
||||
@@ -247,7 +247,7 @@ METHOD(task_t, build_i, status_t,
|
||||
linked_list_t *proposals;
|
||||
packet_t *packet;
|
||||
|
||||
DBG0(DBG_IKE, "initiating Main Mode IKE_SA %s[%d] to %H",
|
||||
DBG0(DBG_IKE, "initiating Main Mode IKE_SA %s[%u] to %H",
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa),
|
||||
this->ike_sa->get_other_host(this->ike_sa));
|
||||
|
||||
@@ -172,7 +172,7 @@ static bool allowed(private_xauth_t *this)
|
||||
*/
|
||||
static bool establish(private_xauth_t *this)
|
||||
{
|
||||
DBG0(DBG_IKE, "IKE_SA %s[%d] established between %H[%Y]...%H[%Y]",
|
||||
DBG0(DBG_IKE, "IKE_SA %s[%u] established between %H[%Y]...%H[%Y]",
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa),
|
||||
this->ike_sa->get_my_host(this->ike_sa),
|
||||
|
||||
@@ -54,7 +54,7 @@ METHOD(task_t, build_i, status_t,
|
||||
{
|
||||
delete_payload_t *delete_payload;
|
||||
|
||||
DBG0(DBG_IKE, "deleting IKE_SA %s[%d] between %H[%Y]...%H[%Y]",
|
||||
DBG0(DBG_IKE, "deleting IKE_SA %s[%u] between %H[%Y]...%H[%Y]",
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa),
|
||||
this->ike_sa->get_my_host(this->ike_sa),
|
||||
@@ -71,7 +71,7 @@ METHOD(task_t, build_i, status_t,
|
||||
}
|
||||
this->ike_sa->set_state(this->ike_sa, IKE_DELETING);
|
||||
|
||||
DBG1(DBG_IKE, "sending DELETE for IKE_SA %s[%d]",
|
||||
DBG1(DBG_IKE, "sending DELETE for IKE_SA %s[%u]",
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa));
|
||||
|
||||
@@ -122,10 +122,10 @@ METHOD(task_t, process_r, status_t,
|
||||
{
|
||||
/* we don't even scan the payloads, as the message wouldn't have
|
||||
* come so far without being correct */
|
||||
DBG1(DBG_IKE, "received DELETE for IKE_SA %s[%d]",
|
||||
DBG1(DBG_IKE, "received DELETE for IKE_SA %s[%u]",
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa));
|
||||
DBG0(DBG_IKE, "deleting IKE_SA %s[%d] between %H[%Y]...%H[%Y]",
|
||||
DBG0(DBG_IKE, "deleting IKE_SA %s[%u] between %H[%Y]...%H[%Y]",
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa),
|
||||
this->ike_sa->get_my_host(this->ike_sa),
|
||||
|
||||
@@ -53,7 +53,7 @@ METHOD(task_t, process_r, status_t,
|
||||
*/
|
||||
static void establish(private_ike_establish_t *this)
|
||||
{
|
||||
DBG0(DBG_IKE, "IKE_SA %s[%d] established between %H[%Y]...%H[%Y]",
|
||||
DBG0(DBG_IKE, "IKE_SA %s[%u] established between %H[%Y]...%H[%Y]",
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa),
|
||||
this->ike_sa->get_my_host(this->ike_sa),
|
||||
|
||||
@@ -153,7 +153,7 @@ static void establish_new(private_ike_rekey_t *this)
|
||||
job_t *job;
|
||||
|
||||
this->new_sa->set_state(this->new_sa, IKE_ESTABLISHED);
|
||||
DBG0(DBG_IKE, "IKE_SA %s[%d] rekeyed between %H[%Y]...%H[%Y]",
|
||||
DBG0(DBG_IKE, "IKE_SA %s[%u] rekeyed between %H[%Y]...%H[%Y]",
|
||||
this->new_sa->get_name(this->new_sa),
|
||||
this->new_sa->get_unique_id(this->new_sa),
|
||||
this->ike_sa->get_my_host(this->ike_sa),
|
||||
@@ -593,7 +593,7 @@ static bool collision_lost(private_ike_rekey_t *this, bool multi_ke)
|
||||
else
|
||||
{
|
||||
DBG1(DBG_IKE, "IKE_SA rekey collision lost, deleting redundant "
|
||||
"IKE_SA %s[%d]", this->new_sa->get_name(this->new_sa),
|
||||
"IKE_SA %s[%u]", this->new_sa->get_name(this->new_sa),
|
||||
this->new_sa->get_unique_id(this->new_sa));
|
||||
delete_redundant(this);
|
||||
}
|
||||
@@ -614,14 +614,14 @@ static bool collision_lost(private_ike_rekey_t *this, bool multi_ke)
|
||||
if (multi_ke)
|
||||
{
|
||||
DBG1(DBG_IKE, "IKE_SA rekey collision won, continue with multi-KE "
|
||||
"rekeying and wait for delete for redundant IKE_SA %s[%d]",
|
||||
"rekeying and wait for delete for redundant IKE_SA %s[%u]",
|
||||
other->new_sa->get_name(other->new_sa),
|
||||
other->new_sa->get_unique_id(other->new_sa));
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG1(DBG_IKE, "IKE_SA rekey collision won, waiting for delete for "
|
||||
"redundant IKE_SA %s[%d]",
|
||||
"redundant IKE_SA %s[%u]",
|
||||
other->new_sa->get_name(other->new_sa),
|
||||
other->new_sa->get_unique_id(other->new_sa));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user