BGP: Fix non-transitive ext communities
This commit is contained in:
parent
3e7923507b
commit
d807ea087f
3 changed files with 12 additions and 1 deletions
|
@ -536,6 +536,13 @@ ec_set_sort(struct linpool *pool, struct adata *src)
|
||||||
return dst;
|
return dst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ec_set_sort_x(struct adata *set)
|
||||||
|
{
|
||||||
|
/* Sort in place */
|
||||||
|
qsort(set->data, set->length / 8, 8, ec_set_cmp);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
lc_set_cmp(const void *X, const void *Y)
|
lc_set_cmp(const void *X, const void *Y)
|
||||||
|
|
|
@ -197,4 +197,6 @@ struct adata *int_set_sort(struct linpool *pool, struct adata *src);
|
||||||
struct adata *ec_set_sort(struct linpool *pool, struct adata *src);
|
struct adata *ec_set_sort(struct linpool *pool, struct adata *src);
|
||||||
struct adata *lc_set_sort(struct linpool *pool, struct adata *src);
|
struct adata *lc_set_sort(struct linpool *pool, struct adata *src);
|
||||||
|
|
||||||
|
void ec_set_sort_x(struct adata *set); /* Sort in place */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -550,10 +550,12 @@ bgp_decode_mp_unreach_nlri(struct bgp_parse_state *s, uint code UNUSED, uint fla
|
||||||
static void
|
static void
|
||||||
bgp_export_ext_community(struct bgp_export_state *s, eattr *a)
|
bgp_export_ext_community(struct bgp_export_state *s, eattr *a)
|
||||||
{
|
{
|
||||||
|
a->u.ptr = ec_set_del_nontrans(s->pool, a->u.ptr);
|
||||||
|
|
||||||
if (a->u.ptr->length == 0)
|
if (a->u.ptr->length == 0)
|
||||||
UNSET(a);
|
UNSET(a);
|
||||||
|
|
||||||
a->u.ptr = ec_set_sort(s->pool, a->u.ptr);
|
ec_set_sort_x(a->u.ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue