From c156232a530b30b6668712eda22bc491b0900283 Mon Sep 17 00:00:00 2001 From: "Jose M. Guisado Gomez" Date: Fri, 21 Aug 2020 18:40:30 +0200 Subject: 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 Signed-off-by: Pablo Neira Ayuso --- src/parser_bison.y | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/parser_bison.y') diff --git a/src/parser_bison.y b/src/parser_bison.y index d4e99417..95adc48f 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -1533,6 +1533,10 @@ table_options : FLAGS STRING YYERROR; } } + | comment_spec + { + $0->comment = $1; + } ; table_block : /* empty */ { $$ = $
-1; } -- cgit v1.2.3