diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-10-13 17:20:51 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-11-16 15:43:35 +0100 |
commit | e13cc805783440571d8c80a45fad2db1fdcca787 (patch) | |
tree | 30ca86cd544a0d50ce2401bdd831d4ef00fd13b6 /bgpd | |
parent | bgpd: Cleanup show_adj_route_vpn to be easier to read (diff) | |
download | frr-e13cc805783440571d8c80a45fad2db1fdcca787.tar.xz frr-e13cc805783440571d8c80a45fad2db1fdcca787.zip |
bgpd: Cleanup non-usage of prefix2str in bgp_vpn.c
We were printing out a prefix by not using the prefix2str function.
Let's use that.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'bgpd')
-rw-r--r-- | bgpd/bgp_vpn.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/bgpd/bgp_vpn.c b/bgpd/bgp_vpn.c index b31005717..54ca980ca 100644 --- a/bgpd/bgp_vpn.c +++ b/bgpd/bgp_vpn.c @@ -193,14 +193,10 @@ int show_adj_route_vpn(struct vty *vty, struct peer *peer, rd_header = 0; } if (use_json) { - char buf_a[BUFSIZ]; - char buf_b[BUFSIZ]; - - sprintf(buf_a, "%s/%d", - inet_ntop(rm->p.family, rm->p.u.val, - buf_b, BUFSIZ), - rm->p.prefixlen); - json_object_object_add(json_routes, buf_a, + char buf[BUFSIZ]; + + prefix2str(&rm->p, buf, sizeof(buf)); + json_object_object_add(json_routes, buf, json_array); } else { route_vty_out_tmp(vty, &rm->p, path->attr, |