Skip to content

RFC simplify nf_tables family and filter chain infra

Pablo Neira Ayuso netfilter-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest8 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8netfilter: nf_tables: remove nhooks field from struct nft_af_infoinclude/net/netfilter/nf_tables.h net/bridge/netfilter/nf_tables_bridge.c net/ipv4/netfilter/nf_tables_arp.c +5 more+0 -120 replies
2/8netfilter: nf_tables: remove flag field from struct nft_af_infoinclude/net/netfilter/nf_tables.h net/netfilter/nf_tables_api.c net/netfilter/nf_tables_netdev.c+1 -80 replies
3/8netfilter: nf_tables: no need for struct nft_af_info to enable/disable tablenet/netfilter/nf_tables_api.c+6 -150 replies
4/8netfilter: nf_tables: remove struct nft_af_info parameter in nf_tables_chain_type_lookup()net/netfilter/nf_tables_api.c+7 -90 replies
5/8netfilter: nf_tables: add single table list for all familiesinclude/net/netfilter/nf_tables.h include/net/netns/nftables.h net/netfilter/nf_tables_api.c +1 more+227 -2410 replies
6/8netfilter: nf_tables: get rid of pernet familiesinclude/net/netfilter/nf_tables.h include/net/netns/nftables.h net/bridge/netfilter/nf_tables_bridge.c +6 more+71 -2250 replies
7/8netfilter: nf_tables: get rid of struct nft_af_info abstractioninclude/net/netfilter/nf_tables.h net/bridge/netfilter/nf_tables_bridge.c net/ipv4/netfilter/nf_tables_arp.c +5 more+72 -3510 replies
8/8netfilter: nf_tables: consolidate filter chain definitionsinclude/net/netfilter/nf_tables.h net/bridge/netfilter/Makefile net/bridge/netfilter/nf_tables_bridge.c +9 more+307 -4570 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH nf-next RFC 0/8] simplify nf_tables family and filter chain infra

Hi,

This patchset simplifies the nf_tables infrastructure by removing the family abstraction. As a side effect, nf_tables netns support also consumes 48 bytes less in x86_64 and its logic becomes simpler.

Last patch consolidate all filter chain definitions.

Note that this patchset depends on removal of the raw socket check [1].

Compiled tested only, will send a new iteration after a more accurate review and test.

[1] http://patchwork.ozlabs.org/patch/854171/

Pablo Neira Ayuso (8):
netfilter: nf_tables: remove nhooks field from struct nft_af_info
netfilter: nf_tables: remove flag field from struct nft_af_info
netfilter: nf_tables: no need for struct nft_af_info to enable/disable table
netfilter: nf_tables: remove struct nft_af_info parameter in nf_tables_chain_type_lookup()
netfilter: nf_tables: add single table list for all families
netfilter: nf_tables: get rid of pernet families
netfilter: nf_tables: get rid of struct nft_af_info abstraction
netfilter: nf_tables: consolidate filter chain definitions

 include/net/netfilter/nf_tables.h       |  40 +-
 include/net/netns/nftables.h            |   7 +-
 net/bridge/netfilter/Makefile           |   1 -
 net/bridge/netfilter/nf_tables_bridge.c | 129 ------
 net/ipv4/netfilter/Makefile             |   2 -
 net/ipv4/netfilter/nf_tables_arp.c      |  49 +--
 net/ipv4/netfilter/nf_tables_ipv4.c     | 112 ------
 net/ipv6/netfilter/Makefile             |   1 -
 net/ipv6/netfilter/nf_tables_ipv6.c     | 110 ------
 net/netfilter/Makefile                  |   5 +-
 net/netfilter/nf_tables_api.c           | 680 ++++++++++++--------------------
 net/netfilter/nf_tables_inet.c          | 141 -------
 net/netfilter/nf_tables_netdev.c        | 186 ---------
 net/netfilter/nft_chain_filter.c        | 294 ++++++++++++++
 14 files changed, 565 insertions(+), 1192 deletions(-)
 delete mode 100644 net/bridge/netfilter/nf_tables_bridge.c
 delete mode 100644 net/ipv4/netfilter/nf_tables_ipv4.c
 delete mode 100644 net/ipv6/netfilter/nf_tables_ipv6.c
 delete mode 100644 net/netfilter/nf_tables_inet.c
 delete mode 100644 net/netfilter/nf_tables_netdev.c
 create mode 100644 net/netfilter/nft_chain_filter.c
Signature · 1 line
2.11.0