nft -o/--optimize crashes with verdict maps due to insufficient checks on the expression type for verdict statements. This patchset extends -o/--optimize to merge two rules with the same verdict maps side by side. This also prepares for allowing to merge raw expressions in concatenation which is not possible yet due to the use of integer type. Pablo Neira Ayuso (4): optimize: add __expr_cmp() optimize: merge verdict maps with same lookup key optimize: check for payload base and offset when searching for mergers optimize: do not merge raw payload expressions src/optimize.c | 210 +++++++++++++----- .../optimizations/dumps/merge_vmaps.nft | 12 + .../shell/testcases/optimizations/merge_vmaps | 25 +++ 3 files changed, 189 insertions(+), 58 deletions(-) create mode 100644 tests/shell/testcases/optimizations/dumps/merge_vmaps.nft create mode 100755 tests/shell/testcases/optimizations/merge_vmaps -- 2.30.2