]> git.ipfire.org Git - thirdparty/nftables.git/commit
meta: Fix hour_type size
authorPhil Sutter <phil@nwl.cc>
Wed, 10 Mar 2021 10:45:47 +0000 (11:45 +0100)
committerPhil Sutter <phil@nwl.cc>
Tue, 30 Nov 2021 13:57:46 +0000 (14:57 +0100)
commit4e1abfc552170d6db5c511634a29918e64c1b51b
treec33900e470e6461ea300c99948255d47b7ef852e
parent94e4e77d4343dff02ecd6079f7de34279510a5d9
meta: Fix hour_type size

In kernel as well as when parsing, hour_type is assumed to be 32bits.
Having the struct datatype field set to 64bits breaks Big Endian and so
does passing a 64bit value and 32 as length to constant_expr_alloc() as
it makes it import the upper 32bits. Fix this by turning 'result' into a
uint32_t and introduce a temporary uint64_t just for the call to
time_parse() which expects that.

Fixes: f8f32deda31df ("meta: Introduce new conditions 'time', 'day' and 'hour'")
Signed-off-by: Phil Sutter <phil@nwl.cc>
src/meta.c