From: James Cowgill <James.Cowgill@imgtec.com>
To: <netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH iptables] extensions: libxt_hashlimit: fix 64-bit printf formats
Date: Mon, 10 Apr 2017 10:38:44 +0100 [thread overview]
Message-ID: <e6f3b34b-eec5-77cf-abd6-66ce90a1e7f8@imgtec.com> (raw)
In-Reply-To: <20170408202917.GA3568@salvia>
On 08/04/17 21:29, Pablo Neira Ayuso wrote:
> 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.
Yes removing the spaces around PRIu64 should be fine.
James
next prev parent reply other threads:[~2017-04-10 9:38 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
2017-04-10 9:38 ` James Cowgill [this message]
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=e6f3b34b-eec5-77cf-abd6-66ce90a1e7f8@imgtec.com \
--to=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.