bgp_attr_set_community(&attr, community);
}
- if (ecommunity) {
+ if (ecommunity)
bgp_attr_set_ecommunity(&attr, ecommunity);
- attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES);
- }
if (lcommunity)
bgp_attr_set_lcommunity(&attr, lcommunity);
ecomm = bgp_attr_get_ecommunity(attr);
ecommunity_unintern(&ecomm);
- UNSET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES));
bgp_attr_set_ecommunity(attr, NULL);
ipv6_ecomm = bgp_attr_get_ipv6_ecommunity(attr);
ecommunity_unintern(&ipv6_ecomm);
- UNSET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_IPV6_EXT_COMMUNITIES));
bgp_attr_set_ipv6_ecommunity(attr, NULL);
lcomm = bgp_attr_get_lcommunity(attr);
return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_OPT_ATTR_ERR,
args->total);
- attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES);
-
/* Extract DF election preference and mobility sequence number */
attr->df_pref = bgp_attr_df_pref_from_ec(attr, &attr->df_alg);
return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_OPT_ATTR_ERR,
args->total);
- attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_IPV6_EXT_COMMUNITIES);
-
return BGP_ATTR_PARSE_PROCEED;
}
struct ecommunity *ecomm)
{
attr->ecommunity = ecomm;
+
+ if (ecomm)
+ SET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES));
+ else
+ UNSET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES));
}
static inline struct lcommunity *
struct ecommunity *ipv6_ecomm)
{
attr->ipv6_ecommunity = ipv6_ecomm;
+
+ if (ipv6_ecomm)
+ SET_FLAG(attr->flag,
+ ATTR_FLAG_BIT(BGP_ATTR_IPV6_EXT_COMMUNITIES));
+ else
+ UNSET_FLAG(attr->flag,
+ ATTR_FLAG_BIT(BGP_ATTR_IPV6_EXT_COMMUNITIES));
}
static inline struct transit *bgp_attr_get_transit(const struct attr *attr)
ecommunity_add_val(bgp_attr_get_ecommunity(attr), &eval_rmac,
true, true);
}
-
- attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES);
}
/*
attr, ecommunity_merge(bgp_attr_get_ecommunity(attr),
&ecom_na));
}
-
- attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES);
}
/*
bgp_attr_set_ecommunity(
attr,
ecommunity_merge(bgp_attr_get_ecommunity(attr), &ecom_df));
-
- attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES);
}
/* Create or update local type-4 route */
ecom));
}
}
-
- attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES);
}
/* Extended communities associated with EAD-per-EVI */
bgp_attr_set_ecommunity(
attr,
ecommunity_merge(bgp_attr_get_ecommunity(attr), ecom));
-
- attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES);
}
/* Update EVPN EAD (type-1) route -
if (community) {
bgp_attr_set_community(&attr, community);
}
- if (ecomm) {
+ if (ecomm)
bgp_attr_set_ecommunity(&attr, ecomm);
- attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES);
- }
if (lcomm)
bgp_attr_set_lcommunity(&attr, lcomm);
.rtlist[BGP_VPN_POLICY_DIR_TOVPN]);
}
bgp_attr_set_ecommunity(&static_attr, new_ecom);
- SET_FLAG(static_attr.flag, ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES));
if (debug && bgp_attr_get_ecommunity(&static_attr)) {
char *s = ecommunity_ecom2str(
bgp_attr_set_ecommunity(&static_attr, new_ecom);
if (new_ecom->size == 0) {
- UNSET_FLAG(static_attr.flag,
- ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES));
ecommunity_free(&new_ecom);
bgp_attr_set_ecommunity(&static_attr, NULL);
}
attr = path->attr;
if (rcs->none) {
- attr->flag &= ~(ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES));
bgp_attr_set_ecommunity(attr, NULL);
return RMAP_OKAY;
}
/* will be intern()'d or attr_flush()'d by bgp_update_main() */
bgp_attr_set_ecommunity(path->attr, new_ecom);
- path->attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES);
-
return RMAP_OKAY;
}
/* new_ecom will be intern()'d or attr_flush()'d in call stack */
bgp_attr_set_ecommunity(path->attr, new_ecom);
- path->attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES);
/* Mark that route-map has set link bandwidth; used in attribute
* setting decisions.
struct ecommunity *ecomm = bgp_attr_get_ecommunity(&attr);
- if (ecomm->size) {
- attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES);
- } else {
+ if (!ecomm->size) {
ecommunity_free(&ecomm);
bgp_attr_set_ecommunity(&attr, NULL);
}
} else {
bgp_attr_set_ecommunity(new, ecom_ro);
}
- if (ecom_ro) {
- new->flag |= ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES);
- }
/*
* Set MED