diff options
| author | Louis Scalbert <louis.scalbert@6wind.com> | 2025-01-09 18:28:53 +0100 | 
|---|---|---|
| committer | Mergify <37929162+mergify[bot]@users.noreply.github.com> | 2025-01-09 20:58:58 +0000 | 
| commit | 2de8f291d415e6e14fd91ce0e7d457853d62dd57 (patch) | |
| tree | 3a70bce1065efd6c5bfff73117c2aa5074312182 | |
| parent | 0501a4800ef4657c4ec92d347a15ae2455e07b61 (diff) | |
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 commit 8ccf60921b85893d301186a0f8156fb702da379f)
| -rw-r--r-- | lib/plist.c | 3 | 
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/plist.c b/lib/plist.c index 40b3c8e498..60c0bda443 100644 --- a/lib/plist.c +++ b/lib/plist.c @@ -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));  | 
