summaryrefslogtreecommitdiff
path: root/nest/config.Y
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2015-07-18 19:30:35 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2015-07-18 19:30:35 +0200
commit17661ff934a80d517284c96756357d4ed5af9a64 (patch)
treea31a6d5b12aa7f7e9eaf7a865e9642d1d4680864 /nest/config.Y
parent6683d42d5b560c8805b977736b2a769ea2d9aa8b (diff)
Nest: Fixes symbols in router id
Thanks to Peter Hudec for noticing the problem.
Diffstat (limited to 'nest/config.Y')
-rw-r--r--nest/config.Y11
1 files changed, 11 insertions, 0 deletions
diff --git a/nest/config.Y b/nest/config.Y
index 37551802..7ad6c712 100644
--- a/nest/config.Y
+++ b/nest/config.Y
@@ -94,6 +94,7 @@ rtrid:
idval:
NUM { $$ = $1; }
+ | '(' term ')' { $$ = f_eval_int($2); }
| RTRID
| IPA {
#ifndef IPV6
@@ -102,6 +103,16 @@ idval:
cf_error("Router IDs must be entered as hexadecimal numbers or IPv4 addresses in IPv6 version");
#endif
}
+ | SYM {
+ if ($1->class == (SYM_CONSTANT | T_INT) || $1->class == (SYM_CONSTANT | T_QUAD))
+ $$ = SYM_VAL($1).i;
+#ifndef IPV6
+ else if ($1->class == (SYM_CONSTANT | T_IP))
+ $$ = SYM_VAL($1).px.ip;
+#endif
+ else
+ cf_error("Number of IPv4 address constant expected");
+ }
;