mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-03 15:16:20 +00:00
bgpd: fix crash in displaying json orf prefix-list
bgpd crashes when there is several entries in the prefix-list. No backtrace is provided because the issue was catched from a code review. Fixes:856ca177c4
("Added json formating support to show-...-neighbors-... bgp commands.") Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com> (cherry picked from commit8ccf60921b
)
This commit is contained in:
parent
1d9c7aebc7
commit
fc34397b29
@ -1536,7 +1536,6 @@ int prefix_bgp_show_prefix_list(struct vty *vty, afi_t afi, char *name,
|
||||
if (use_json) {
|
||||
json = json_object_new_object();
|
||||
json_prefix = json_object_new_object();
|
||||
json_list = json_object_new_object();
|
||||
|
||||
json_object_int_add(json_prefix, "prefixListCounter",
|
||||
plist->count);
|
||||
@ -1544,6 +1543,8 @@ int prefix_bgp_show_prefix_list(struct vty *vty, afi_t afi, char *name,
|
||||
plist->name);
|
||||
|
||||
for (pentry = plist->head; pentry; pentry = pentry->next) {
|
||||
json_list = json_object_new_object();
|
||||
|
||||
json_object_int_add(json_list, "seq", pentry->seq);
|
||||
json_object_string_add(json_list, "seqPrefixListType",
|
||||
prefix_list_type_str(pentry));
|
||||
|
Loading…
Reference in New Issue
Block a user