From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id CA9B71FF0B2 for ; Mon, 24 Aug 2026 10:59:00 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 6734E2175B; Mon, 24 Aug 2026 10:57:25 +0200 (CEST) From: Daniel Kral To: pve-devel@lists.proxmox.com Subject: [PATCH cluster 11/12] pmxcfs: server: do not forward qb_ipc_request_header to s1_msg_handle_request Date: Mon, 24 Aug 2026 10:56:10 +0200 Message-ID: <20260824085610.111211-13-d.kral@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260824085610.111211-2-d.kral@proxmox.com> References: <20260824085610.111211-2-d.kral@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1787561806653 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.893 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: NLNLB5CX436TS4MWZZ6MMHIODX3YVSV6 X-Message-ID-Hash: NLNLB5CX436TS4MWZZ6MMHIODX3YVSV6 X-MailFrom: d.kral@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: request_id and request_size is already passed to s1_msg_handle_request(), which therefore do not need the information from struct qb_ipc_request_header passed on to them. This is done in preparation of an upcoming patch, where the IPC server has to handle two different types of request headers to negotiate what responses the client can handle. The request headers do have different sizes and therefore an union cannot be used here. Signed-off-by: Daniel Kral --- src/pmxcfs/server.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/pmxcfs/server.c b/src/pmxcfs/server.c index c53d4e0..46ad381 100644 --- a/src/pmxcfs/server.c +++ b/src/pmxcfs/server.c @@ -56,18 +56,15 @@ static GCond server_stopped_cond; static GMutex server_started_mutex; typedef struct { - struct qb_ipc_request_header req_header; char name[256]; } cfs_status_update_request_header_t; typedef struct { - struct qb_ipc_request_header req_header; char name[256]; char nodename[256]; } cfs_status_get_request_header_t; typedef struct { - struct qb_ipc_request_header req_header; uint8_t priority; uint8_t ident_len; uint8_t tag_len; @@ -75,7 +72,6 @@ typedef struct { } cfs_log_msg_request_header_t; typedef struct { - struct qb_ipc_request_header req_header; uint32_t max_entries; uint32_t res1; uint32_t res2; @@ -83,21 +79,18 @@ typedef struct { } cfs_log_get_request_header_t; typedef struct { - struct qb_ipc_request_header req_header; uint32_t vmid; char property[]; } cfs_guest_config_propery_get_request_header_t; typedef struct { - struct qb_ipc_request_header req_header; uint32_t vmid; uint8_t num_props; char props[]; /* list of \0 terminated properties */ } cfs_guest_config_properties_get_request_header_t; typedef struct { - struct qb_ipc_request_header req_header; - char token[]; + char *token; } cfs_verify_token_request_header_t; struct s1_context { @@ -164,7 +157,7 @@ static int32_t s1_msg_handle_request( int32_t result = -ECHRNG; if (request_id == CFS_IPC_GET_FS_VERSION) { - if (request_size != sizeof(struct qb_ipc_request_header)) { + if (request_size != 0) { result = -EINVAL; } else { result = cfs_create_version_msg(outbuf); @@ -172,7 +165,7 @@ static int32_t s1_msg_handle_request( } else if (request_id == CFS_IPC_GET_CLUSTER_INFO) { - if (request_size != sizeof(struct qb_ipc_request_header)) { + if (request_size != 0) { result = -EINVAL; } else { result = cfs_create_memberlist_msg(outbuf); @@ -180,7 +173,7 @@ static int32_t s1_msg_handle_request( } else if (request_id == CFS_IPC_GET_GUEST_LIST) { - if (request_size != sizeof(struct qb_ipc_request_header)) { + if (request_size != 0) { result = -EINVAL; } else { result = cfs_create_vmlist_msg(outbuf); @@ -220,14 +213,14 @@ static int32_t s1_msg_handle_request( } } else if (request_id == CFS_IPC_GET_CONFIG) { - int pathlen = request_size - sizeof(struct qb_ipc_request_header); + int pathlen = request_size; if (pathlen <= 0) { result = -EINVAL; } else { /* make sure path is 0 terminated */ ((char *)data)[request_size - 1] = 0; - char *path = (char *)data + sizeof(struct qb_ipc_request_header); + char *path = (char *)data; if (ctx->read_only && path_is_private(path)) { result = -EPERM; @@ -294,7 +287,7 @@ static int32_t s1_msg_handle_request( } } else if (request_id == CFS_IPC_GET_RRD_DUMP) { - if (request_size != sizeof(struct qb_ipc_request_header)) { + if (request_size != 0) { result = -EINVAL; } else { cfs_rrd_dump(outbuf); @@ -484,7 +477,8 @@ static int32_t s1_msg_process_fn(qb_ipcs_connection_t *c, void *data, size_t siz } int32_t request_id = req_pt->id; - int32_t request_size = req_pt->size; + int32_t request_size = req_pt->size - sizeof(struct qb_ipc_request_header); + data = (uint8_t *)data + sizeof(struct qb_ipc_request_header); cfs_debug("process msg:%d, size:%d", request_id, request_size); int32_t result = s1_msg_handle_request(ctx, data, request_id, request_size); -- 2.47.3