]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fixes unnamed protocols from templates
authorOndrej Zajicek <santiago@crfreenet.org>
Fri, 22 May 2015 09:12:48 +0000 (11:12 +0200)
committerOndrej Zajicek <santiago@crfreenet.org>
Fri, 22 May 2015 09:12:48 +0000 (11:12 +0200)
nest/config.Y

index 939bed6a8c527a27b0e40184ec3fbcff5e7ff6d2..375518022a74ebc9de9888a6cf834fcb0a06989a 100644 (file)
@@ -183,16 +183,18 @@ proto_name:
    }
  | FROM SYM {
      struct symbol *s = cf_default_name(this_proto->protocol->template, &this_proto->protocol->name_counter);
+     s->class = this_proto->class;
+     s->def = this_proto;
      this_proto->name = s->name;
+
      if (($2->class != SYM_TEMPLATE) && ($2->class != SYM_PROTO)) cf_error("Template or protocol name expected");
      proto_copy_config(this_proto, $2->def);
    }
  | SYM FROM SYM {
-     if (($3->class != SYM_TEMPLATE) && ($3->class != SYM_PROTO)) cf_error("Template or protocol name expected");
-
      cf_define_symbol($1, this_proto->class, this_proto);
      this_proto->name = $1->name;
 
+     if (($3->class != SYM_TEMPLATE) && ($3->class != SYM_PROTO)) cf_error("Template or protocol name expected");
      proto_copy_config(this_proto, $3->def);
    }
  ;