static void cluster_unintern(struct cluster_list **cluster)
{
+ if (!*cluster)
+ return;
+
if ((*cluster)->refcnt)
(*cluster)->refcnt--;
bgp_attr_set_lcommunity(attr, NULL);
cluster = bgp_attr_get_cluster(attr);
- if (cluster) {
- cluster_unintern(&cluster);
- bgp_attr_set_cluster(attr, cluster);
- }
- UNSET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_CLUSTER_LIST));
+ cluster_unintern(&cluster);
+ bgp_attr_set_cluster(attr, NULL);
struct transit *transit = bgp_attr_get_transit(attr);
/* XXX: Fix cluster_parse to use stream API and then remove this */
stream_forward_getp(peer->curr, length);
- attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_CLUSTER_LIST);
-
return BGP_ATTR_PARSE_PROCEED;
cluster_list_ignore:
struct cluster_list *cl)
{
attr->cluster1 = cl;
+
+ if (cl)
+ SET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_CLUSTER_LIST));
+ else
+ UNSET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_CLUSTER_LIST));
}
static inline const struct bgp_route_evpn *