netfilter: add hook dump feature
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest4 patches 0 repliesNew
- v14 patches 5 repliesSuperseded
Changes in v2 from the cover letter
Patch 1: init 'ret' to avoid unitialised value
Patch 4:
- include attribute that this is about nf_tables to allow later extension to x_tables if needed for some reason.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | netfilter: nf_tables: allow to dump all registered base hooksinclude/ net/ net/ | +219 | 0 replies | |
| 2/4 | netfilter: nf_tables: include function and module name in hook dumpsinclude/ include/ net/ +1 more | +27 | 0 replies | |
| 3/4 | netfilter: annotate nf_tables base hook opsinclude/ net/ | +10 | 0 replies | |
| 4/4 | netfilter: nf_tables: include table and chain name when dumping hooksinclude/ net/ | +78 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH nf-next v2 0/4] netfilter: add hook dump feature
Changes in v2:
Patch 1: init 'ret' to avoid unitialised value
Patch 4:
- include attribute that this is about nf_tables to allow later extension to x_tables if needed for some reason.
Enable dump of the registered netfilter hooks to userspace. This allows userspace to peek at the active hooks for each family/hook point.
Example:
$ nft list hook ip type input
family ip hook input {
+0000000000 nft_do_chain_inet [nf_tables] # nft table ip filter chain input
+0000000010 nft_do_chain_inet [nf_tables] # nft table ip firewalld chain filter_INPUT
+0000000100 nf_nat_ipv4_local_in [nf_nat]
+2147483647 ipv4_confirm [nf_conntrack]
}Implementation is done in nf_tables.
Alternative would be to add this as a separate/new nfnetlink family.
Let me know if thats the preferred route and I will respin. I did this in nf_tables because it allows re-use of the existing nft_hook_attributes and it seemed strange to add a new kernel module for this.
Florian Westphal (4):
netfilter: nf_tables: allow to dump all registered base hooks
netfilter: nf_tables: include function and module name in hook dumps
netfilter: annotate nf_tables base hook ops
netfilter: nf_tables: include table and chain name when dumping hooks
include/linux/netfilter.h | 12 +- include/uapi/linux/netfilter/nf_tables.h | 30 +++ net/netfilter/core.c | 6 + net/netfilter/nf_queue.c | 4 +- net/netfilter/nf_tables_api.c | 286 ++++++++++++++++++++++- 5 files changed, 334 insertions(+), 4 deletions(-)
Signature · 1 line
2.26.3