]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
kernel-handler: Log CPU ID that's passed with an acquire
authorTobias Brunner <tobias@strongswan.org>
Mon, 26 Sep 2022 14:55:00 +0000 (16:55 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 28 May 2025 14:35:27 +0000 (16:35 +0200)
src/libcharon/kernel/kernel_handler.c

index 8bbb44917035aff5594989e16e0edd2d411670f8..6aa6b3a1b75837ac49de7bbd90dee32e8a2893de 100644 (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));