diff options
| -rw-r--r-- | bgpd/bgp_evpn_vty.c | 2 | ||||
| -rw-r--r-- | bgpd/bgp_route.c | 19 |
2 files changed, 21 insertions, 0 deletions
diff --git a/bgpd/bgp_evpn_vty.c b/bgpd/bgp_evpn_vty.c index ca6edffab0..44e9375dc9 100644 --- a/bgpd/bgp_evpn_vty.c +++ b/bgpd/bgp_evpn_vty.c @@ -2480,6 +2480,8 @@ static void evpn_show_all_routes(struct vty *vty, struct bgp *bgp, int type, bgp_evpn_show_route_header(vty, bgp, tbl_ver, json); + vty_out(vty, "%19s Extended Community\n" + , " "); header = 0; } diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 4ae018698d..3e9afe0392 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -6965,6 +6965,7 @@ void route_vty_out(struct vty *vty, struct prefix *p, json_object *json_nexthops = NULL; json_object *json_nexthop_global = NULL; json_object *json_nexthop_ll = NULL; + json_object *json_ext_community = NULL; char vrf_id_str[VRF_NAMSIZ] = {0}; bool nexthop_self = CHECK_FLAG(path->flags, BGP_PATH_ANNC_NH_SELF) ? true : false; @@ -7330,6 +7331,17 @@ void route_vty_out(struct vty *vty, struct prefix *p, vty_out(vty, "%s", bgp_origin_str[attr->origin]); if (json_paths) { + if (safi == SAFI_EVPN && + attr->flag & ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES)) { + json_ext_community = json_object_new_object(); + json_object_string_add(json_ext_community, + "string", + attr->ecommunity->str); + json_object_object_add(json_path, + "extendedCommunity", + json_ext_community); + } + if (nexthop_self) json_object_boolean_true_add(json_path, "announceNexthopSelf"); @@ -7363,6 +7375,13 @@ void route_vty_out(struct vty *vty, struct prefix *p, json_object_array_add(json_paths, json_path); } else { vty_out(vty, "\n"); + + if (safi == SAFI_EVPN && + attr->flag & ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES)) { + vty_out(vty, "%*s", 20, " "); + vty_out(vty, "%s\n", attr->ecommunity->str); + } + #if ENABLE_BGP_VNC /* prints an additional line, indented, with VNC info, if * present */ |
