Skip to content

Implement among match support

Phil Sutter netfilter-devel 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest12 patches 1 replyIn review
  2. v312 patches 8 repliesSuperseded
  3. v212 patches 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v114 patches15 repliesSuperseded

Changes in v4 from the cover letter

- Rebase onto current master.
- Whitespace fixup in patch 7.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12nft: family_ops: Pass nft_handle to 'add' callbackiptables/nft-arp.c iptables/nft-bridge.c iptables/nft-ipv4.c +4 more+14 -120 replies
2/12nft: family_ops: Pass nft_handle to 'rule_find' callbackiptables/nft-arp.c iptables/nft-bridge.c iptables/nft-shared.c +2 more+10 -110 replies
3/12nft: family_ops: Pass nft_handle to 'print_rule' callbackiptables/nft-arp.c iptables/nft-bridge.c iptables/nft-ipv4.c +3 more+20 -180 replies
4/12nft: family_ops: Pass nft_handle to 'rule_to_cs' callbackiptables/nft-arp.c iptables/nft-bridge.c iptables/nft-ipv4.c +7 more+43 -260 replies
5/12nft: Keep nft_handle pointer in nft_xt_ctxiptables/nft-shared.c iptables/nft-shared.h+15 -270 replies
6/12nft: Eliminate pointless calls to nft_family_ops_lookup()iptables/nft.c+5 -100 replies
7/12nft: Introduce NFT_CL_SETS cache leveliptables/nft-cache.c iptables/nft-cache.h iptables/nft.h+200 -90 replies
8/12nft: Support NFT_COMPAT_SET_ADDiptables/nft.c+58 -00 replies
9/12nft: Bore up nft_parse_payload()iptables/nft-shared.c iptables/nft-shared.h+11 -10 replies
10/12nft: Embed rule's table name in nft_xt_ctxiptables/nft-shared.c iptables/nft-shared.h+2 -00 replies
11/12nft: Support parsing lookup expressioniptables/nft-shared.c iptables/nft-shared.h iptables/nft.c+13 -10 replies
12/12nft: bridge: Rudimental among extension supportextensions/libebt_among.c extensions/libebt_among.t iptables/ebtables-nft.8 +4 more+710 -310 replies

Reviews trailers per patch

None of the 12 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchPablo Neira Ayuso
SeriesA-b
1/12
2/12
3/12
4/12
5/12
6/12
7/12
8/12
9/12
10/12
11/12
12/12

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [iptables PATCH v4 00/12] Implement among match support

Changes since v3:
- Rebase onto current master.
- Whitespace fixup in patch 7.

Changes since v2:
- Rebased onto current master branch. With cache levels being upstream, no dependencies on unfinished work remains.
- Integrate sets caching into cache level infrastructure.
- Fixed temporary build breakage within series.
- Larger review of last patch containing the actual among match extension.

Changes since v1:
- Rebased onto my performance improvements patch series.
- Aligned set caching routines with changes in above series.
- Fixed patch ordering so builds are not broken intermittently.
- Replaced magic numbers by defines or offsetof() statements. Note that I did not move any defines into libnftnl; the remaining ones are for values in sets' key_type attribute which neither libnftnl nor kernel care about. Setting that is merely for compatibility with nft tool.

This series ultimately adds among match support to ebtables-nft. The implementation merely shares the user interface with legacy one, internally the code is distinct: libebt_among.c does not make use of the wormhash data structure but a much simpler one for "temporary" storage of data until being converted into an anonymous set and associated lookup expression.

Patches 1 to 5 implement required changes and are rather boring by
themselves: When converting an nftnl rule to iptables command state, cache access is required (to lookup set references).

Patch 6 simplifies things a bit with the above in place.

Patches 7 to 11 implement anonymous set support.

Patch 12 then adds the actual among match implementation for ebtables-nft.

Phil Sutter (12):
nft: family_ops: Pass nft_handle to 'add' callback
nft: family_ops: Pass nft_handle to 'rule_find' callback
nft: family_ops: Pass nft_handle to 'print_rule' callback
nft: family_ops: Pass nft_handle to 'rule_to_cs' callback
nft: Keep nft_handle pointer in nft_xt_ctx
nft: Eliminate pointless calls to nft_family_ops_lookup()
nft: Introduce NFT_CL_SETS cache level
nft: Support NFT_COMPAT_SET_ADD
nft: Bore up nft_parse_payload()
nft: Embed rule's table name in nft_xt_ctx
nft: Support parsing lookup expression
nft: bridge: Rudimental among extension support

 extensions/libebt_among.c  | 243 +++++++++++++++++++++++++++++++++
 extensions/libebt_among.t  |  16 +++
 iptables/ebtables-nft.8    |  66 ++++-----
 iptables/nft-arp.c         |  13 +-
 iptables/nft-bridge.c      | 232 ++++++++++++++++++++++++++++++--
 iptables/nft-bridge.h      |  56 ++++++++
 iptables/nft-cache.c       | 205 ++++++++++++++++++++++++++--
 iptables/nft-cache.h       |   2 +
 iptables/nft-ipv4.c        |  10 +-
 iptables/nft-ipv6.c        |  10 +-
 iptables/nft-shared.c      |  70 +++++-----
 iptables/nft-shared.h      |  26 ++--
 iptables/nft.c             | 269 ++++++++++++++++++++++++++++++++-----
 iptables/nft.h             |   8 +-
 iptables/xtables-eb.c      |   1 +
 iptables/xtables-monitor.c |  17 ++-
 iptables/xtables-save.c    |   3 +
 17 files changed, 1101 insertions(+), 146 deletions(-)
 create mode 100644 extensions/libebt_among.c
 create mode 100644 extensions/libebt_among.t
Signature · 1 line
2.24.0