routermac_ecom.val[0] = ECOMMUNITY_ENCODE_EVPN;
routermac_ecom.val[1] = ECOMMUNITY_EVPN_SUBTYPE_ROUTERMAC;
memcpy(&routermac_ecom.val[2], routermac->octet, ETH_ALEN);
- if (!ecomm)
+ if (!ecomm) {
bgp_attr_set_ecommunity(attr, ecommunity_new());
+ ecomm = bgp_attr_get_ecommunity(attr);
+ }
ecommunity_add_val(ecomm, &routermac_ecom, false, false);
ecommunity_str(ecomm);
}
struct transit *transit;
struct cluster_list *cluster;
char buf[BUFSIZ];
- struct ecommunity *ecomm = bgp_attr_get_ecommunity(attr);
+ struct ecommunity *ecomm;
if (rfapiStream2Vty(stream, &fp, &vty, &out, &vty_newline) == 0)
return;
fp(out, " community=%p, refcnt=%d%s", attr->community,
(attr->community ? attr->community->refcnt : 0), HVTYNL);
+ ecomm = bgp_attr_get_ecommunity(attr);
fp(out, " ecommunity=%p, refcnt=%d%s", ecomm,
(ecomm ? ecomm->refcnt : 0), HVTYNL);