From 19cd540390e32f2e1f62e205ddb691d1e6e06152 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Wed, 12 Jul 2017 14:14:16 +0200 Subject: src: Allow passing the parent set to set_expr_alloc() Usually one wants to at least initialize set_flags from the parent, so make allocation of a set's set expression more convenient. The idea to do this came when fixing an issue with output formatting of larger anonymous sets in nft monitor: Since netlink_events_cache_addset() didn't initialize set_flags, calculate_delim() didn't detect it's an anonymous set and therefore added newlines to the output. Reported-by: Arturo Borrero Gonzalez Fixes: a9dc3ceabc10f ("expression: print sets and maps in pretty format") Signed-off-by: Phil Sutter Acked-by: Arturo Borrero Gonzalez Signed-off-by: Pablo Neira Ayuso --- src/parser_bison.y | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/parser_bison.y') diff --git a/src/parser_bison.y b/src/parser_bison.y index 03b13720..45b1dc9f 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -1796,7 +1796,7 @@ verdict_map_expr : '{' verdict_map_list_expr '}' verdict_map_list_expr : verdict_map_list_member_expr { - $$ = set_expr_alloc(&@$); + $$ = set_expr_alloc(&@$, NULL); compound_expr_add($$, $1); } | verdict_map_list_expr COMMA verdict_map_list_member_expr @@ -2581,7 +2581,7 @@ set_expr : '{' set_list_expr '}' set_list_expr : set_list_member_expr { - $$ = set_expr_alloc(&@$); + $$ = set_expr_alloc(&@$, NULL); compound_expr_add($$, $1); } | set_list_expr COMMA set_list_member_expr -- cgit v1.2.3