[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180425111141.3b6488bd@xeon-e3>
Date: Wed, 25 Apr 2018 11:11:41 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: Toke Høiland-Jørgensen <toke@...e.dk>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH iproute2 v3] json_print: Fix hidden 64-bit type
promotion
On Wed, 25 Apr 2018 17:28:57 +0200
Toke Høiland-Jørgensen <toke@...e.dk> wrote:
> print_uint() will silently promote its variable type to uint64_t, but there
> is nothing that ensures that the format string specifier passed along with
> it fits (and the function name suggest to pass "%u").
>
> Fix this by changing print_uint() to use a native 'unsigned int' type, and
> introduce a separate print_u64() function for printing 64-bit values. All
> call sites that were actually printing 64-bit values using print_uint() are
> converted to use print_u64() instead.
>
> Since print_int() was already using native int types, just add a
> print_s64() to match, but don't convert any call sites. For symmetry,
> also add a print_luint() method (with no users).
>
> Signed-off-by: Toke Høiland-Jørgensen <toke@...e.dk>
Looks good, applied. This also fixes glitches in mroute and neigh output.
Powered by blists - more mailing lists