Skip to content

Commit

Permalink
[CUMULUS] bgpd: add evpn prefix in json output
Browse files Browse the repository at this point in the history
PR 4850 has changed JSON output format where
evpn prefix is dissected to display each
fields. In effort to do so, it removed the
evpn prefix and prefixlen fields which causes
a regression issue in exisitng cli parser.
Adding back evpn prefix and prefixlen.

Ticket: CM-30105
Reviewed By:CCR-10420
Testing Done:

TORS1# show bgp l2vpn evpn route vni 1002 mac
00:02:00:00:00:01 ip fe80::202:ff:fe00:1 json
{
  "prefix":"[2]:[0]:[48]:[00:02:00:00:00:01]:[128]:[fe80::202:ff:fe00:1]",
  "prefixLen":352,
  "rd":"",
  "routeType":2,
  "ethTag":0,
  "macLen":48,
  "mac":"00:02:00:00:00:01",
  "ipLen":128,
  "ip":"fe80::202:ff:fe00:1",
  "paths":[
    [
      {
        "VNI":"1002\/4001",
        "aspath":{
...

Signed-off-by: Chirag Shah <[email protected]>
  • Loading branch information
chiragshah6 authored and donaldsharp committed Dec 7, 2024
1 parent a691a94 commit 49ce5e7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -11860,6 +11860,11 @@ void route_vty_out_detail_header(struct vty *vty, struct bgp *bgp,
: "",
prd ? ":" : "", (struct prefix_evpn *)p);
} else {
char prefix_str[BUFSIZ];

prefix2str((const struct prefix_evpn *)p, prefix_str, sizeof(prefix_str));
json_object_string_add(json, "prefix", prefix_str);
json_object_int_add(json, "prefixLen", p->prefixlen);
json_object_string_add(
json, "rd",
prd ? prefix_rd2str(prd, buf1, sizeof(buf1),
Expand Down

0 comments on commit 49ce5e7

Please sign in to comment.