Skip to content
Snippets Groups Projects
Commit ec331acf authored by Ondřej Zajíček's avatar Ondřej Zajíček
Browse files

BGP: Fix handling of transitive extended communities

Transitive extended communities should be removed on external sessions,
the old code them in all cases.

Thanks to Jean-Daniel Pauget for the original patch.
parent 5ce881be
No related branches found
No related tags found
No related merge requests found
Pipeline #54770 passed with warnings
......@@ -717,13 +717,23 @@ bgp_decode_mp_unreach_nlri(struct bgp_parse_state *s, uint code UNUSED, uint fla
static void
bgp_export_ext_community(struct bgp_export_state *s, eattr *a)
{
struct adata *ad = ec_set_del_nontrans(s->pool, a->u.ptr);
if (!s->proto->is_interior)
{
struct adata *ad = ec_set_del_nontrans(s->pool, a->u.ptr);
if (ad->length == 0)
UNSET(a);
if (ad->length == 0)
UNSET(a);
ec_set_sort_x(ad);
a->u.ptr = ad;
ec_set_sort_x(ad);
a->u.ptr = ad;
}
else
{
if (a->u.ptr->length == 0)
UNSET(a);
a->u.ptr = ec_set_sort(s->pool, a->u.ptr);
}
}
static void
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment