Skip to content

Commit

Permalink
bgpd: fix bgp orf prefix-list json prefix
Browse files Browse the repository at this point in the history
0x<address>FX was displayed instead of the prefix.

Fixes: b219dda ("lib: Convert usage of strings to %pFX and %pRN")
Signed-off-by: Louis Scalbert <[email protected]>
(cherry picked from commit b7e843d)
  • Loading branch information
louis-6wind authored and mergify[bot] committed Jan 9, 2025
1 parent de8be50 commit 0501a48
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/plist.c
Original file line number Diff line number Diff line change
Expand Up @@ -1544,11 +1544,6 @@ int prefix_bgp_show_prefix_list(struct vty *vty, afi_t afi, char *name,
plist->name);

for (pentry = plist->head; pentry; pentry = pentry->next) {
struct prefix *p = &pentry->prefix;
char buf_a[BUFSIZ];

snprintf(buf_a, sizeof(buf_a), "%pFX", p);

json_object_int_add(json_list, "seq", pentry->seq);
json_object_string_add(json_list, "seqPrefixListType",
prefix_list_type_str(pentry));
Expand All @@ -1560,7 +1555,7 @@ int prefix_bgp_show_prefix_list(struct vty *vty, afi_t afi, char *name,
json_object_int_add(json_list, "le",
pentry->le);

json_object_object_add(json_prefix, buf_a, json_list);
json_object_object_addf(json_prefix, json_list, "%pFX", &pentry->prefix);
}
if (afi == AFI_IP)
json_object_object_add(json, "ipPrefixList",
Expand Down

0 comments on commit 0501a48

Please sign in to comment.