From: Maria Matejka Date: Fri, 13 Oct 2023 12:02:21 +0000 (+0200) Subject: Merge commit 'cce48c6c' into thread-next X-Git-Tag: v3.0.0~385 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7efa3bac4f9a8e2ac00d0e2bb92db85bc12731b5;p=thirdparty%2Fbird.git Merge commit 'cce48c6c' into thread-next --- 7efa3bac4f9a8e2ac00d0e2bb92db85bc12731b5 diff --cc conf/confbase.Y index 195efff16,a6b4b1eec..40ea16de3 --- a/conf/confbase.Y +++ b/conf/confbase.Y @@@ -121,9 -118,10 +121,9 @@@ CF_DECL %type text opttext %type bytestring -%type symbol -%type kw_sym +%type symbol symbol_known toksym - %type bytestring_text + %type bytestring_text text_or_ipa %type bytestring_expr %nonassoc PREFIX_DUMMY @@@ -412,9 -399,27 +412,27 @@@ opttext | /* empty */ { $$ = NULL; } ; + text_or_ipa: + TEXT { $$.type = T_STRING; $$.val.s = $1; } + | IP4 { $$.type = T_IP; $$.val.ip = ipa_from_ip4($1); } + | IP6 { $$.type = T_IP; $$.val.ip = ipa_from_ip6($1); } + | CF_SYM_KNOWN { + if (($1->class == (SYM_CONSTANT | T_STRING)) || + ($1->class == (SYM_CONSTANT | T_IP))) + $$ = *($1->val); + else + cf_error("String or IP constant expected"); + } + | '(' term ')' { - $$ = cf_eval($2, T_VOID); ++ $$ = *cf_eval($2, T_VOID); + if (($$.type != T_BYTESTRING) && ($$.type != T_STRING)) + cf_error("Bytestring or string value expected"); + } + ; + bytestring: BYTETEXT - | bytestring_expr { $$ = cf_eval($1, T_BYTESTRING).val.bs; } + | bytestring_expr { $$ = cf_eval($1, T_BYTESTRING)->val.bs; } ; bytestring_text: diff --cc filter/config.Y index 238a1c468,e02af182d..53884bb7b --- a/filter/config.Y +++ b/filter/config.Y @@@ -337,7 -324,8 +337,7 @@@ CF_KEYWORDS(FUNCTION, PRINT, PRINTN, UN %nonassoc ELSE %type cmds_int cmd_prep - %type term term_bs cmd cmd_var cmds cmds_scoped constant constructor print_list var var_init var_list function_call symbol_value bgp_path_expr bgp_path bgp_path_tail + %type term term_bs cmd cmd_var cmds cmds_scoped constant constructor print_list var var_list function_call symbol_value bgp_path_expr bgp_path bgp_path_tail -%type dynamic_attr %type static_attr %type filter where_filter %type filter_body function_body