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=ca+lLuoq; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 1C96E5A061C for ; Tue, 21 Apr 2026 08:25:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202602; t=1776752718; bh=STgwZtz3JxgmOvifYAnlClQ3BsgNQdSnhnfCSs5yreM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ca+lLuoqNc+TRnjwFARc0lRrC0NZcFIgCRuoHO6z22IbQrBjBKhUK+yP9mBh2YsMi aljIkXhBbXNZTavHwwPEdfkQtgnxQY67dYLTJCJVhggtaeyv86bWZKrci9eEFK5dKg OzJnEGk7PBur/O/XLr4ATB72HHBpvTLhV92E59oDRuKXc6VC2qqoVYbU/e1BVUdEyE k++p3qOUGFbHkSrtN10uGDIM2Dv7j05JMNdVBWbCjt0z5d1RUShyMuGJ1thh5bdaTD tkXTClHHEN/8u9Ly+lTY7zLY0rFX0avhxHII06wa1C32WW0nbTmku4N8/PSMCteyCP eWibFhdkv+VRw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4g0C5V2XSvz4wJc; Tue, 21 Apr 2026 16:25:18 +1000 (AEST) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH v5 07/18] fwd_rule: Fix some format specifiers Date: Tue, 21 Apr 2026 16:25:05 +1000 Message-ID: <20260421062516.2601204-8-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260421062516.2601204-1-david@gibson.dropbear.id.au> References: <20260421062516.2601204-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: 5NTCZGABWALJTPS3AT6IT7DRV5QZOZ32 X-Message-ID-Hash: 5NTCZGABWALJTPS3AT6IT7DRV5QZOZ32 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