From 61d6c3834de32c0ff5808c93da94b2b30b4791c8 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Mon, 12 Nov 2018 14:40:41 +0100 Subject: xtables: add 'printf' attribute to xlate_add This allows gcc to check format string vs. passed arguments. Fix the fallout from this as well, typical warning produced is: libebt_mark_m.c:112:28: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat=] xt_xlate_add(xl, "and 0x%x %s0 ", info->mask, ... ~^ ~~~~~~~~~~ so add the required casts or fixup format strings as needed. libxt_conntrack also passed an unneeded argument (port), so remove that. Signed-off-by: Florian Westphal --- extensions/libxt_MARK.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'extensions/libxt_MARK.c') diff --git a/extensions/libxt_MARK.c b/extensions/libxt_MARK.c index 5c6186fe..43aa9779 100644 --- a/extensions/libxt_MARK.c +++ b/extensions/libxt_MARK.c @@ -277,13 +277,13 @@ static int MARK_xlate(struct xt_xlate *xl, switch(markinfo->mode) { case XT_MARK_SET: - xt_xlate_add(xl, "0x%x ", markinfo->mark); + xt_xlate_add(xl, "0x%x ", (uint32_t)markinfo->mark); break; case XT_MARK_AND: - xt_xlate_add(xl, "mark and 0x%x ", markinfo->mark); + xt_xlate_add(xl, "mark and 0x%x ", (uint32_t)markinfo->mark); break; case XT_MARK_OR: - xt_xlate_add(xl, "mark or 0x%x ", markinfo->mark); + xt_xlate_add(xl, "mark or 0x%x ", (uint32_t)markinfo->mark); break; } -- cgit v1.2.3