From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202602 header.b=dQlk9tT/; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 891575A0623 for ; Tue, 21 Apr 2026 06:42:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202602; t=1776746539; bh=STgwZtz3JxgmOvifYAnlClQ3BsgNQdSnhnfCSs5yreM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dQlk9tT/QKWxh1N61RC0arD+jOkumaNVdLlySNQ/3XgSVhK53sTTvYfXB1YgrGxzH JPnH5Zs9kxK7PRTJMOrNRI4pIO8y2s1AK/N5DpkNdEXS+nLzPRLwvVPBhVx+obY6y8 b+nCMr2qykIPxRIsqLWBCPBh0FA5qLptvsgw1brfDOAwODdTfb2h4tZX70+x5kyY5Z WgMw3KP1MLuvwEavTuSHDd6FWzibYz8bwLrjHWw2pmZ9OQIrcx4X3WBhIrLwfUVWY8 q/Z48czyhpBUaZvaSuBjT5nb45VcIuX5jWhRMp5aIhrxnESM/vkvmAWYF5xyesfJbH 9qzu/j0vPqQ0g== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4g08pg41Cdz4wJK; Tue, 21 Apr 2026 14:42:19 +1000 (AEST) From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH v4 07/17] fwd_rule: Fix some format specifiers Date: Tue, 21 Apr 2026 14:42:07 +1000 Message-ID: <20260421044217.2500314-8-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260421044217.2500314-1-david@gibson.dropbear.id.au> References: <20260421044217.2500314-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: AZYFZJG3G2ISUNPBWNEJOHPL2QPU5YPN X-Message-ID-Hash: AZYFZJG3G2ISUNPBWNEJOHPL2QPU5YPN X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The new warnings in fwd_rule_add() have some not quite technically correct format specifiers. For some weird reason these don't trip warnings on passt itself, but do when we re-use this code in the upcoming configuration client. Fix them. Signed-off-by: David Gibson --- fwd_rule.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fwd_rule.c b/fwd_rule.c index 777282da..7fd20dda 100644 --- a/fwd_rule.c +++ b/fwd_rule.c @@ -208,7 +208,7 @@ static int fwd_rule_add(struct fwd_table *fwd, const struct fwd_rule *new) return -EINVAL; } if (new->flags & ~allowed_flags) { - warn("Rule has invalid flags 0x%hhx", + warn("Rule has invalid flags 0x%x", new->flags & ~allowed_flags); return -EINVAL; } @@ -267,11 +267,11 @@ static int fwd_rule_add(struct fwd_table *fwd, const struct fwd_rule *new) } if (fwd->count >= ARRAY_SIZE(fwd->rules)) { - warn("Too many rules (maximum %u)", ARRAY_SIZE(fwd->rules)); + warn("Too many rules (maximum %d)", ARRAY_SIZE(fwd->rules)); return -ENOSPC; } if ((fwd->sock_count + num) > ARRAY_SIZE(fwd->socks)) { - warn("Rules require too many listening sockets (maximum %u)", + warn("Rules require too many listening sockets (maximum %d)", ARRAY_SIZE(fwd->socks)); return -ENOSPC; } -- 2.53.0