netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: James Cowgill <James.Cowgill@imgtec.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH iptables] extensions: libxt_hashlimit: fix 64-bit printf formats
Date: Sat, 8 Apr 2017 22:29:17 +0200	[thread overview]
Message-ID: <20170408202917.GA3568@salvia> (raw)
In-Reply-To: <1491565649-16679-1-git-send-email-James.Cowgill@imgtec.com>

On Fri, Apr 07, 2017 at 12:47:29PM +0100, James Cowgill wrote:
> hashlimit was using "%lu" in a lot of printf format specifiers to print
> 64-bit integers. This is incorrect on 32-bit architectures because
> "long int" is 32-bits there. On MIPS, it was causing iptables to
> segfault when printing these integers.
> 
> Fix by using the correct format specifier.

One comment below...

> @@ -262,7 +262,7 @@ static uint64_t parse_burst(const char *burst, int revision)
>  	if (v > max)
>  		xtables_error(PARAMETER_PROBLEM, "bad value for option "
>  			"\"--hashlimit-burst\", value \"%s\" too large "
> -				"(max %lumb).", burst, max/1024/1024);
> +				"(max %" PRIu64 "mb).", burst, max/1024/1024);
                                        ^      ^

I can remove this whitespaces, right? I'm looking at other spots in
the iptables code and I would like to keep this consistent.

No need to resent the patch, I can just mangle this here and apply.

Thanks!

  parent reply	other threads:[~2017-04-08 20:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-07 11:47 [PATCH iptables] extensions: libxt_hashlimit: fix 64-bit printf formats James Cowgill
2017-04-07 12:17 ` Arturo Borrero Gonzalez
2017-04-08 20:29 ` Pablo Neira Ayuso [this message]
2017-04-10  9:38   ` James Cowgill
2017-04-10 15:59   ` Jan Engelhardt
2017-04-11  7:00     ` Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170408202917.GA3568@salvia \
    --to=pablo@netfilter.org \
    --cc=James.Cowgill@imgtec.com \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).