Skip to content

second batch of typeof fixes

Florian Westphal netfilter-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4tests: add shift+and typeof test casestests/shell/testcases/sets/dumps/typeof_sets_0.nft tests/shell/testcases/sets/typeof_sets_0+29 -00 replies
2/4payload: skip templates with meta key setsrc/payload.c+3 -00 replies
3/4netlink_delinearize: and/shift postprocessingsrc/netlink_delinearize.c+7 -00 replies
4/4netlink_delinearize: zero shift removalsrc/netlink_delinearize.c tests/shell/testcases/sets/dumps/typeof_sets_0.nft tests/shell/testcases/sets/typeof_sets_0+37 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH nft 0/4] second batch of typeof fixes

This series makes typeof-sets work in corner cases such as

set s4 { typeof frag frag-off }
set s8 { typeof ip version }

frag frag-off @s4 accept
ip version @s8

Due to the shift/mask expressions needed to cope with these delinearization can't figure out the correct payload/exthdr templates and nft lists this as:

(frag unknown & 0xfff8 [invalid type]) >> 3 == @s4 (ip l4proto & pfsync) >> 4 == @s8

With this series, the mask/shift expressions are removed and nft can print them in a readable way.

Florian Westphal (4):
tests: add shift+and typeof test cases
payload: skip templates with meta key set
netlink_delinearize: and/shift postprocessing
netlink_delinearize: zero shift removal

 src/netlink_delinearize.c                  | 28 +++++++++++++++++++
 src/payload.c                              |  3 ++
 .../testcases/sets/dumps/typeof_sets_0.nft | 23 +++++++++++++++
 tests/shell/testcases/sets/typeof_sets_0   | 22 +++++++++++++++
 4 files changed, 76 insertions(+)
Signature · 1 line
2.32.0