Skip to content

src: mnl: rework list hooks infra

Florian Westphal netfilter-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest5 patches 1 replyIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5src: mnl: clean up hook listing codesrc/mnl.c+35 -630 replies
2/5src: mnl: make family specification more strict when listingsrc/mnl.c+24 -290 replies
3/5src: drop obsolete hook argument form hook dump functionsinclude/mnl.h src/mnl.c src/rule.c+15 -190 replies
4/5src: add egress support for 'list hooks'src/mnl.c+4 -30 replies
5/5doc: add documentation about list hooks featureMakefile.am doc/additional-commands.txt doc/nft.txt+118 -620 replies

Reviews trailers per patch

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

Read the v2 thread

Cover letter [PATCH nft v2 0/5] src: mnl: rework list hooks infra

Turns out that not only was 'nft list hooks' mostly undocumented, there was also confusion on what it should do.

First, clean this code up and make it strictly a tool to dump the NFPROTO_X registered functions.

Then, remove the 'hook' function argument, this was still passed from back in the day when one could ask to only dump e.g. ipv4 prerouting. This ability is of little value, so don't restore this but instead just remove the leftover code.

Next, allow dumping of netdev:egress hooks.
Lastly, document this in more detail and make it clear that this dumps the netfilter hooks registered for the protocol families, and nothing else.

Once this gets applied I intend to make
'nft list hooks netdev'

dump device hooks for all interfaces, if any, instead of a 'no device provided' warning.

Florian Westphal (5):
src: mnl: clean up hook listing code
src: mnl: make family specification more strict when listing
src: drop obsolete hook argument form hook dump functions
src: add egress support for 'list hooks'
doc: add documentation about list hooks feature

 Makefile.am                 |   1 +
 doc/additional-commands.txt | 116 ++++++++++++++++++++++++++++
 doc/nft.txt                 |  63 +--------------
 include/mnl.h               |   2 +-
 src/mnl.c                   | 150 ++++++++++++++----------------------
 src/rule.c                  |   6 +-
 6 files changed, 179 insertions(+), 159 deletions(-)
 create mode 100644 doc/additional-commands.txt
Signature · 1 line
2.44.2