iproute2: backport json_print-fix-hidden-64-bit-type-promotion
authorKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Sun, 6 May 2018 14:20:01 +0000 (14:20 +0000)
committerJohn Crispin <john@phrozen.org>
Mon, 7 May 2018 06:09:05 +0000 (08:09 +0200)
commitad5af37ca793b8c065d40a10054fd24b88705180
treee6b5953655d4e82ed9c1cbde3dfb86424c104d88
parent53c474abbdfef8eb3499e2d10c9ad491788b8a72
iproute2: backport json_print-fix-hidden-64-bit-type-promotion

The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.
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.

Fixes wonkyness in some stats from some qdiscs under tc

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
package/network/utils/iproute2/Makefile
package/network/utils/iproute2/patches/002-json_print-fix-hidden-64-bit-type-promotion.patch [new file with mode: 0644]