diff options
author | Jan Moskyto Matejka <mq@ucw.cz> | 2017-03-17 15:48:09 +0100 |
---|---|---|
committer | Jan Moskyto Matejka <mq@ucw.cz> | 2017-03-17 15:48:32 +0100 |
commit | 3c74416465d77c0e79eeaaeb988e471663484b5d (patch) | |
tree | 44f84dccd613fd36700729972d9329369275d785 /conf/confbase.Y | |
parent | a5d2a34497853a02692a0b8ea812f44d6820a399 (diff) |
Nexthop: Fixed recursive route mpls label merging
Diffstat (limited to 'conf/confbase.Y')
-rw-r--r-- | conf/confbase.Y | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/conf/confbase.Y b/conf/confbase.Y index 291dc6a0..d6a6951f 100644 --- a/conf/confbase.Y +++ b/conf/confbase.Y @@ -65,7 +65,7 @@ CF_DECLS struct proto_spec ps; struct channel_limit cl; struct timeformat *tf; - u32 *lbl; + mpls_label_stack *mls; } %token END CLI_MARKER INVALID_TOKEN ELSECOL DDOT @@ -85,7 +85,7 @@ CF_DECLS %type <a> ipa %type <net> net_ip4_ net_ip6_ net_ip6 net_ip_ net_ip net_or_ipa %type <net_ptr> net_ net_any net_vpn4_ net_vpn6_ net_vpn_ net_roa4_ net_roa6_ net_roa_ -%type <lbl> label_stack_start label_stack +%type <mls> label_stack_start label_stack %type <t> text opttext @@ -288,18 +288,17 @@ net_or_ipa: label_stack_start: NUM { - $$ = cfg_allocz(sizeof(u32) * (MPLS_MAX_LABEL_STACK+1)); - $$[0] = 1; - $$[1] = $1; + $$ = cfg_allocz(sizeof(mpls_label_stack)); + $$->len = 1; + $$->stack[0] = $1; }; label_stack: label_stack_start | label_stack '/' NUM { - if ($1[0] >= MPLS_MAX_LABEL_STACK) + if ($1->len >= MPLS_MAX_LABEL_STACK) cf_error("Too many labels in stack"); - $1[0]++; - $1[*$1] = $3; + $1->stack[$1->len++] = $3; $$ = $1; } ; |