From a9721145dcbf55ae69356f5581afbe7a3e2f816f Mon Sep 17 00:00:00 2001 From: Balazs Scheidler Date: Mon, 3 Jun 2024 13:51:22 +0200 Subject: [PATCH] cfg-grammar: fix context for looking up blocks Whenever we have an embedded block in a source/destination/parser/rewrite block, we did not push the log context while parsing those elements. This prevented us from using "block log" elements in these contexts. Fix that up. Signed-off-by: Balazs Scheidler --- lib/cfg-grammar.y | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/cfg-grammar.y b/lib/cfg-grammar.y index 5bc4e6f41e..e20988b2a5 100644 --- a/lib/cfg-grammar.y +++ b/lib/cfg-grammar.y @@ -799,23 +799,23 @@ log_forks ; log_fork - : KW_LOG optional_string '{' log_content '}' + : KW_LOG optional_string '{' _log_context_push log_content _log_context_pop '}' { if ($2) { - log_expr_node_set_name($4, $2); + log_expr_node_set_name($5, $2); free($2); } - $$ = $4; + $$ = $5; } - | KW_CHANNEL optional_string '{' log_content '}' + | KW_CHANNEL optional_string '{' _log_context_push log_content _log_context_pop '}' { if ($2) { - log_expr_node_set_name($4, $2); + log_expr_node_set_name($5, $2); free($2); } - $$ = $4; + $$ = $5; } ;