Skip to content

RFC Netfilter/nf_tables ingress support

Pablo Neira Ayuso netdev netfilter-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest7 patches 31 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7net: refactor __netif_receive_skb_corenet/core/dev.c+89 -676 replies
2/7netfilter: add nf_hook_list_active()include/linux/netfilter.h+12 -50 replies
3/7netfilter: add hook list to nf_hook_stateinclude/linux/netfilter.h net/netfilter/core.c+7 -60 replies
4/7netfilter: cleanup struct nf_hook_ops struct indentationinclude/linux/netfilter.h+7 -71 reply
5/7net: add netfilter ingress hookinclude/linux/netdevice.h include/linux/netfilter.h include/linux/netfilter_ingress.h +3 more+145 -28 replies
6/7netfilter: nf_tables: allow to bind table to net_deviceinclude/net/netfilter/nf_tables.h include/uapi/linux/netfilter/nf_tables.h net/netfilter/nf_tables_api.c+52 -50 replies
7/7netfilter: nf_tables: add netdev table to filter from ingressinclude/net/netns/nftables.h net/netfilter/Kconfig net/netfilter/Makefile +1 more+190 -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 0/7 RFC] Netfilter/nf_tables ingress support

This patchset adds the Netfilter hook at the ingress path, in a per-device fashion. This also comes with the new nf_tables 'netdev' family support to provide access to users to the existing nf_tables features. This includes the transactional netlink API and the enhanced set infrastructure. Several patches come in first place to prepare this support, including the refactoring of __netif_receive_skb_core() to accomodate the new hook.

As in other netfilter hooks, a static key is used to disable the hook path when no hooks are registered, so the ingress path remains similar to what we already have. The static key that governs this is global.

The netfilter ingress hook comes just after handle_ing() to honor the existing qdisc ingress infrastructure.

You can find a simple example ruleset file to account traffic at:

http://people.netfilter.org/pablo/nft-ingress.ruleset

Comments are welcome, thanks.

Pablo Neira Ayuso (7):
net: refactor __netif_receive_skb_core
netfilter: add nf_hook_list_active()
netfilter: add hook list to nf_hook_state
netfilter: cleanup struct nf_hook_ops struct indentation
net: add netfilter ingress hook
netfilter: nf_tables: allow to bind table to net_device
netfilter: nf_tables: add netdev table to filter from ingress

 include/linux/netdevice.h		  |    4 +-
 include/linux/netfilter.h		  |   39 +++---
 include/linux/netfilter_ingress.h	  |   80 +++++++++++++
 include/net/netfilter/nf_tables.h	  |    8 ++
 include/net/netns/nftables.h		  |    1 +
 include/uapi/linux/netfilter.h		  |    6 +
 include/uapi/linux/netfilter/nf_tables.h |    2 +
 net/core/dev.c				  |  190 +++++++++++++++++++-----------
 net/netfilter/Kconfig			  |    6 +
 net/netfilter/Makefile			  |    1 +
 net/netfilter/core.c			  |   28 ++++-
 net/netfilter/nf_tables_api.c		  |   47 +++++++-
 net/netfilter/nf_tables_netdev.c	  |  182 ++++++++++++++++++++++++++++
 13 files changed, 502 insertions(+), 92 deletions(-)
 create mode 100644 include/linux/netfilter_ingress.h
 create mode 100644 net/netfilter/nf_tables_netdev.c

--
1.7.10.4