From e13cc805783440571d8c80a45fad2db1fdcca787 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sat, 13 Oct 2018 11:20:51 -0400 Subject: [PATCH] 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 --- bgpd/bgp_vpn.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/bgpd/bgp_vpn.c b/bgpd/bgp_vpn.c index b310057176..54ca980cad 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, -- 2.39.5