]> git.ipfire.org Git - thirdparty/nftables.git/commit
mergesort: find base value expression type via recursion
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 3 Sep 2020 10:33:21 +0000 (12:33 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 4 Sep 2020 15:19:25 +0000 (17:19 +0200)
commit741a06ac15d2bd903b33e5032f5f6fcd54bebc4e
treefa2a9d76b894e37a76103b370f840719efa02335
parentc3bb98cd10670226de02455f5e45c5a170eec685
mergesort: find base value expression type via recursion

Sets that store flags might contain a mixture of values and binary
operations. Find the base value type via recursion to compare the
expressions.

Make sure concatenations are listed in a deterministic way via
concat_expr_msort_value() which builds a mpz value with the tuple.

Adjust a few tests after this update since listing differs after this
update.

Fixes: 14ee0a979b62 ("src: sort set elements in netlink_get_setelems()")
Fixes: 3926a3369bb5 ("mergesort: unbreak listing with binops")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/mergesort.c
tests/shell/testcases/nft-f/dumps/0012different_defines_0.nft
tests/shell/testcases/sets/0055tcpflags_0 [new file with mode: 0755]
tests/shell/testcases/sets/dumps/0037_set_with_inet_service_0.nft
tests/shell/testcases/sets/dumps/0055tcpflags_0.nft [new file with mode: 0644]