datatype: time_print() ignores -T
Pablo Neira Ayuso
maintainerPATCH 1/1 datatype: time_print() ignores -T
Honor NFT_CTX_OUTPUT_NUMERIC_TIME.
# nft list ruleset
table ip x {
set y {
type ipv4_addr
flags timeout
elements = { 1.1.1.1 timeout 5m expires 1m49s40ms }
}
}
# sudo nft -T list ruleset
table ip x {
set y {
type ipv4_addr
flags timeout
elements = { 1.1.1.1 timeout 300s expires 108s }
}
}Signed-off-by Pablo Neira Ayuso <[email protected]>
--- src/datatype.c | 5 +++++ 1 file changed, 5 insertions(+)
src/datatype.c +5 -0
@@ -911,6 +911,11 @@ void time_print(uint64_t ms, struct output_ctx *octx) {uint64_t days, hours, minutes, seconds; +if (nft_output_seconds (octx)) { +nft_print (octx,"%" PRIu64"s" , ms /1000 ); +return ; + } + days = ms /86400000 ; ms %=86400000 ;
Signature · 1 line
2.20.1