kernel-handler: Log CPU ID that's passed with an acquire

This commit is contained in:
Tobias Brunner 2022-09-26 16:55:00 +02:00
parent d6eed3979b
commit 65b7f9d563

View File

@ -56,13 +56,17 @@ static inline protocol_id_t proto_ip2ike(uint8_t protocol)
METHOD(kernel_listener_t, acquire, bool,
private_kernel_handler_t *this, uint32_t reqid, kernel_acquire_data_t *data)
{
char buf[BUF_LEN] = "", sbuf[BUF_LEN] = "";
char lbuf[BUF_LEN] = "", cbuf[32] = "", sbuf[32] = "";
if (data->label)
{
snprintf(buf, sizeof(buf), ", label {%s}",
snprintf(lbuf, sizeof(lbuf), ", label {%s}",
data->label->get_string(data->label));
}
if (data->cpu != CPU_ID_MAX)
{
snprintf(cbuf, sizeof(cbuf), ", cpu {%u}", data->cpu);
}
if (data->seq)
{
snprintf(sbuf, sizeof(sbuf), ", seq {%u}", data->seq);
@ -70,12 +74,12 @@ METHOD(kernel_listener_t, acquire, bool,
if (data->src && data->dst)
{
DBG1(DBG_KNL, "creating acquire job for policy %R === %R with "
"reqid {%u}%s%s", data->src, data->dst, reqid, buf, sbuf);
"reqid {%u}%s%s%s", data->src, data->dst, reqid, lbuf, cbuf, sbuf);
}
else
{
DBG1(DBG_KNL, "creating acquire job for policy with reqid {%u}%s%s",
reqid, buf, sbuf);
DBG1(DBG_KNL, "creating acquire job for policy with reqid {%u}%s%s%s",
reqid, lbuf, cbuf, sbuf);
}
lib->processor->queue_job(lib->processor,
(job_t*)acquire_job_create(reqid, data));