]> git.ipfire.org Git - thirdparty/nftables.git/commit
src: add comment support when adding tables
authorJose M. Guisado Gomez <guigom@riseup.net>
Fri, 21 Aug 2020 16:40:30 +0000 (18:40 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 28 Aug 2020 17:48:20 +0000 (19:48 +0200)
commitc156232a530b30b6668712eda22bc491b0900283
tree96a5bbe49f6eb483dca2d57f743c95a5129cc082
parentfbd8fb09c50bcee3f046dce2281f25baa4e14927
src: add comment support when adding tables

Adds userdata building logic if a comment is specified when creating a
new table. Adds netlink userdata parsing callback function.

Relies on kernel supporting userdata for nft_table.

Example:

> nft add table ip x { comment "test"\; }
> nft list ruleset

table ip x {
comment "test"
}

Signed-off-by: Jose M. Guisado Gomez <guigom@riseup.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/rule.h
src/mnl.c
src/netlink.c
src/parser_bison.y
src/rule.c
tests/shell/testcases/optionals/comments_table_0 [new file with mode: 0755]
tests/shell/testcases/optionals/dumps/comments_table_0.nft [new file with mode: 0644]