]> git.ipfire.org Git - thirdparty/nftables.git/commit
src: allow use of base integer types as set keys in concatenations
authorFlorian Westphal <fw@strlen.de>
Sun, 17 Apr 2022 20:27:41 +0000 (22:27 +0200)
committerFlorian Westphal <fw@strlen.de>
Mon, 18 Apr 2022 13:32:09 +0000 (15:32 +0200)
commit22b750aa6dc9780c19b9dbe00f9a9e5bb83ea08b
treeabb88c537f558152b6102eb58e4bc63d87a95fbe
parent3ed9fadaab95943146ae0095dfaf868b63d09599
src: allow use of base integer types as set keys in concatenations

"typeof ip saddr . ipsec in reqid" won't work because reqid uses
integer type, i.e. dtype->size is 0.

With "typeof", the size can be derived from the expression length,
via set->key.

This computes the concat length based either on dtype->size or
expression length.

It also updates concat evaluation to permit a zero datatype size
if the subkey expression has nonzero length (i.e., typeof was used).

Signed-off-by: Florian Westphal <fw@strlen.de>
src/evaluate.c