if ((*ecom)->str)
XFREE(MTYPE_ECOMMUNITY_STR, (*ecom)->str);
XFREE(MTYPE_ECOMMUNITY, *ecom);
- ecom = NULL;
}
static void ecommunity_hash_free(struct ecommunity *ecom)
uint8_t *pnt;
uint8_t type = 0;
uint8_t sub_type = 0;
-#define ECOMMUNITY_STR_DEFAULT_LEN 27
+#define ECOMMUNITY_STR_DEFAULT_LEN 64
int str_size;
int str_pnt;
char *str_buf;
else
len = sprintf(str_buf + str_pnt,
"MM:%u", seqnum);
+ } else if (*pnt == ECOMMUNITY_EVPN_SUBTYPE_ND) {
+ uint8_t flags = *++pnt;
+
+ if (flags
+ & ECOMMUNITY_EVPN_SUBTYPE_ND_ROUTER_FLAG)
+ len = sprintf(str_buf + str_pnt,
+ "ND:Router Flag");
} else
unk_ecom = 1;
} else if (type == ECOMMUNITY_ENCODE_REDIRECT_IP_NH) {
len = sprintf(
str_buf + str_pnt,
"FS:marking %u", *(pnt+5));
+ } else if (*pnt
+ == ECOMMUNITY_EVPN_SUBTYPE_ES_IMPORT_RT) {
+ struct ethaddr mac;
+
+ pnt++;
+ memcpy(&mac, pnt, ETH_ALEN);
+ len = sprintf(
+ str_buf + str_pnt,
+ "ES-Import-Rt:%02x:%02x:%02x:%02x:%02x:%02x",
+ (uint8_t)mac.octet[0],
+ (uint8_t)mac.octet[1],
+ (uint8_t)mac.octet[2],
+ (uint8_t)mac.octet[3],
+ (uint8_t)mac.octet[4],
+ (uint8_t)mac.octet[5]);
} else
unk_ecom = 1;
} else {