summaryrefslogtreecommitdiff
path: root/conf
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2023-08-25 04:32:01 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2023-08-25 04:32:01 +0200
commit116285f2b000a4b78044f1bcf1eb1d6655f1d2fe (patch)
treedbd71ae63ccf2e78ef96534e20563c1cf7888f5a /conf
parent32427c9ce119df5457d3d2c6e677429e31a5edad (diff)
RPKI: Fix conflict in config grammar
Diffstat (limited to 'conf')
-rw-r--r--conf/confbase.Y20
1 files changed, 19 insertions, 1 deletions
diff --git a/conf/confbase.Y b/conf/confbase.Y
index f8d24415..a6b4b1ee 100644
--- a/conf/confbase.Y
+++ b/conf/confbase.Y
@@ -121,7 +121,7 @@ CF_DECLS
%type <s> symbol
%type <kw> kw_sym
-%type <v> bytestring_text
+%type <v> bytestring_text text_or_ipa
%type <x> bytestring_expr
%nonassoc PREFIX_DUMMY
@@ -399,6 +399,24 @@ 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);
+ 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; }