mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-10 20:41:01 +00:00
Merge pull request #2498 from pacovn/Coverity_1470098_Logically_dead_code
bgpd: json output fix (Coverity 1470098)
This commit is contained in:
commit
76cd18c9dd
@ -223,21 +223,27 @@ int show_adj_route_vpn(struct vty *vty, struct peer *peer,
|
||||
}
|
||||
rd_header = 0;
|
||||
}
|
||||
route_vty_out_tmp(vty, &rm->p, attr,
|
||||
SAFI_MPLS_VPN,
|
||||
use_json, json_array);
|
||||
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,
|
||||
json_array);
|
||||
} else {
|
||||
route_vty_out_tmp(
|
||||
vty, &rm->p, attr,
|
||||
SAFI_MPLS_VPN, use_json,
|
||||
json_array);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (use_json && rm) {
|
||||
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,
|
||||
json_array);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (use_json) {
|
||||
|
Loading…
Reference in New Issue
Block a user