]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Merge commit 'cce48c6c' into thread-next
authorMaria Matejka <mq@ucw.cz>
Fri, 13 Oct 2023 12:02:21 +0000 (14:02 +0200)
committerMaria Matejka <mq@ucw.cz>
Fri, 13 Oct 2023 12:02:21 +0000 (14:02 +0200)
1  2 
conf/confbase.Y
filter/config.Y
filter/f-inst.c
filter/test.conf
proto/rpki/config.Y

diff --cc conf/confbase.Y
index 195efff163c3592e59df8277f83c69a5c0c7d874,a6b4b1eec5df4c19919a035a3963c0506581a7b0..40ea16de30096f31eff0df2b4305a24bdeeb1af6
@@@ -121,9 -118,10 +121,9 @@@ CF_DECL
  
  %type <t> text opttext
  %type <bs> bytestring
 -%type <s> symbol
 -%type <kw> kw_sym
 +%type <s> symbol symbol_known toksym 
  
- %type <v> bytestring_text
+ %type <v> bytestring_text text_or_ipa
  %type <x> bytestring_expr
  
  %nonassoc PREFIX_DUMMY
@@@ -412,9 -399,27 +412,27 @@@ opttext
   | /* empty */ { $$ = NULL; }
   ;
  
 -     $$ = cf_eval($2, T_VOID);
+ 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);
+      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 238a1c468e2bf0cc1c94732495caefaf9774f6f1,e02af182db3f8ff5da9e1e7c3c240a4936c4c72d..53884bb7b51430896a8e4c52ea3bb17f818be1a6
@@@ -337,7 -324,8 +337,7 @@@ CF_KEYWORDS(FUNCTION, PRINT, PRINTN, UN
  %nonassoc ELSE
  
  %type <xp> cmds_int cmd_prep
- %type <x> 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 <x> 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 <fda> dynamic_attr
  %type <fsa> static_attr
  %type <f> filter where_filter
  %type <fl> filter_body function_body
diff --cc filter/f-inst.c
Simple merge
Simple merge
Simple merge