Skip to content

rework dependency removal

Florian Westphal netfilter-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8tests: adjust output to silence warningstests/py/bridge/icmpX.t tests/py/inet/icmpX.t+4 -45 replies
2/8src: remove exthdr_dependency_killinclude/payload.h include/utils.h src/netlink_delinearize.c +1 more+38 -180 replies
3/8src: add and use payload_dependency_update helperinclude/payload.h src/netlink.c src/netlink_delinearize.c +1 more+31 -260 replies
4/8src: pass proto_ctx to payload_dependency_killinclude/payload.h src/netlink_delinearize.c src/payload.c+28 -220 replies
5/8payload: add basic infrastructure to keep some dependenciessrc/payload.c+59 -10 replies
6/8payload: keep dependencies that enforce a specific l3 protocolsrc/payload.c+42 -30 replies
7/8payload: consider expression type during dependency removalsrc/netlink_delinearize.c src/payload.c+35 -40 replies
8/8tests: silence test casetests/py/inet/ip_tcp.t+2 -20 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/8] rework dependency removal

This series resolves a few shortcomings with the current dependency removal.

Problem is that the current approach sometimes can remove dependencies that are required, i.e. where the removal does change the rule.

Examples:
inet t .. meta nfproto ipv6 tcp dport 22 or
inet t .. ip protocol tcp tcp dport 22
are reduced to 'tcp dport 22'.
ip6 nexthdr icmpv6 icmpv6 type echo-request
becomes 'ipv6 type echo-request' (which is not exactly the same, the implicit dependency nft adds is 'meta l4proto', which skips most extension headers).

I already pushed a couple of test cases to increase coverage.

These patches aim to fix those by making dependency removal more strict.

The additional checks are only done in families other than ip and ipv6, as those are already restricted to a particular l3 protocol.

 include/payload.h         |   14 +-
 include/utils.h           |    1 
 src/netlink.c             |   11 --
 src/netlink_delinearize.c |   27 +----
 src/payload.c             |  224 +++++++++++++++++++++++++++++++++++++++++-----
 tests/py/bridge/icmpX.t   |    4 
 tests/py/inet/icmpX.t     |    4 
 tests/py/inet/ip_tcp.t    |    4 
 8 files changed, 224 insertions(+), 65 deletions(-)