We were printing out a prefix by not using the prefix2str function.
Let's use that.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
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,