0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-09-19 11:55:21 +00:00

BGP: fixed MPLS label stack receiving bug

Introduced in 515df18da7 while merging v2 to v3.
This commit is contained in:
Maria Matejka 2024-01-28 13:14:58 +01:00
parent ea0f2c6194
commit 6a80214fb3
2 changed files with 3 additions and 3 deletions

View File

@ -505,8 +505,6 @@ struct bgp_parse_state {
uint err_subcode;
jmp_buf err_jmpbuf;
adata *mpls_labels;
/* Cached state for bgp_rte_update() */
u32 last_id;
struct rte_src *last_src;

View File

@ -1077,6 +1077,8 @@ bgp_apply_next_hop(struct bgp_parse_state *s, ea_list **to, ip_addr gw, ip_addr
static void
bgp_apply_mpls_labels(struct bgp_parse_state *s, ea_list **to, u32 lnum, u32 labels[lnum])
{
bgp_set_attr_data(to, BA_MPLS_LABEL_STACK, 0, labels, lnum * sizeof labels[0]);
if (lnum > MPLS_MAX_LABEL_STACK)
{
REPORT("Too many MPLS labels ($u)", lnum);
@ -1087,7 +1089,7 @@ bgp_apply_mpls_labels(struct bgp_parse_state *s, ea_list **to, u32 lnum, u32 lab
/* Handle implicit NULL as empty MPLS stack */
if ((lnum == 1) && (labels[0] == BGP_MPLS_NULL))
lnum = s->mpls_labels->length = 0;
lnum = 0;
if (s->channel->cf->gw_mode == GW_DIRECT)
{