]> git.ipfire.org Git - thirdparty/nftables.git/commit
netlink: Introduce struct nft_data_linearize::byteorder
authorPhil Sutter <phil@nwl.cc>
Thu, 13 Nov 2025 16:11:15 +0000 (17:11 +0100)
committerPhil Sutter <phil@nwl.cc>
Tue, 27 Jan 2026 22:01:54 +0000 (23:01 +0100)
commitc06b480ea54bbdc997e69f047360541d141b00e1
tree4354d7c964779e8bfd8253da39a88beb0642a539
parentb74a108432510b8cef62c4d0de1cef754ee70ab1
netlink: Introduce struct nft_data_linearize::byteorder

Bits in this field indicate data is in host byte order and thus may need
conversion when being printed "byte-by-byte" in libnftnl.

With regular immediate values, this field's value has boolean properties
(if non-zero, data is in host byte order). Concatenations may contain
components in different byte order, so with them each bit (at index N)
indicates whether a component (at the same index) is in host byte order.

Communicate a possible byte order conversion in
__netlink_gen_concat_key() back to caller since this has to be respected
when setting 'byteorder' field in struct nft_data_linearize.

String-based values are special: While defined as being in host byte
order in nftables, libnftnl shall print them without prior conversion
like Big Endian values.

Signed-off-by: Phil Sutter <phil@nwl.cc>
include/netlink.h
src/netlink.c