]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Nest: Fixes symbols in router id
authorOndrej Zajicek <santiago@crfreenet.org>
Sat, 18 Jul 2015 17:30:35 +0000 (19:30 +0200)
committerOndrej Zajicek <santiago@crfreenet.org>
Sat, 18 Jul 2015 17:30:35 +0000 (19:30 +0200)
Thanks to Peter Hudec for noticing the problem.

nest/config.Y

index 375518022a74ebc9de9888a6cf834fcb0a06989a..7ad6c712e4454a81b42b59285b3b3643f3d6b46d 100644 (file)
@@ -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");
+   }
  ;