extensions: libxt_hashlimit: fix 64-bit printf formats
PATCH v2 1/1 extensions: libxt_hashlimit: fix 64-bit printf formats
Furthermore, this extension use a mix of PRIu64 and %llu formats for uint64_t values. IMO it should use only one, for the sake of consistency.
Signed-off-by Alin Nastac <[email protected]>
--- extensions/libxt_hashlimit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
extensions/libxt_hashlimit.c +1 -1
@@ -942,7 +942,7 @@ static void print_packets_rate_xlate(struct xt_xlate *xl, uint64_t avg, _rates[i].mult / avg < _rates[i].mult % avg) break; -xt_xlate_add (xl," %llu/%s burst %lu packets" , +xt_xlate_add (xl," %" PRIu64"/%s burst %" PRIu64" packets" , _rates[i-1 ].mult / avg, _rates[i-1 ].name, burst); }
Signature · 1 line
2.7.4
Pablo Neira Ayuso
maintainerQuoted 13 lines · Alin Nastac
Furthermore, this extension use a mix of PRIu64 and %llu formats for
uint64_tvalues. IMO it should use only one, for the sake of consistency.Signed-off-by Alin Nastac <[email protected]>--- extensions/libxt_hashlimit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)extensions/libxt_hashlimit.c +0
-0
extensions/libxt_hashlimit.c static void print_packets_rate_xlate(struct xt_xlate *xl, uint64_t avg, · line 946
Quoted 6 lines
extensions/libxt_hashlimit.c +1
-1@@ -942,7 +942,7 @@ static void print_packets_rate_xlate(struct xt_xlate *xl, uint64_t avg, _rates[i].mult / avg < _rates[i].mult % avg)break ; -xt_xlate_add (xl," %llu/%s burst %lu packets" , +xt_xlate_add (xl," %" PRIu64"/%s burst %" PRIu64" packets" , _rates[i-1 ].mult / avg, _rates[i-1 ].name, burst);
Are there more spots that can be converted in this extensions/libxt_hashlimit.c file?
I see more %llu in spots for burst. If so, it would be great to fix them all.