summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Scalbert <louis.scalbert@6wind.com>2025-01-09 18:24:39 +0100
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2025-01-09 20:58:58 +0000
commit0501a4800ef4657c4ec92d347a15ae2455e07b61 (patch)
tree18a44652b0b65aa6f38e7f5fa5952c1a4e7a164b
parentde8be500d2a843dae812aed2cc083c9d768bf8ab (diff)
bgpd: fix bgp orf prefix-list json prefix
0x<address>FX was displayed instead of the prefix. Fixes: b219dda129 ("lib: Convert usage of strings to %pFX and %pRN") Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com> (cherry picked from commit b7e843d7e8afe57d3815dbb44e30307654e73711)
-rw-r--r--lib/plist.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/plist.c b/lib/plist.c
index 3fc8e2a1ff..40b3c8e498 100644
--- a/lib/plist.c
+++ b/lib/plist.c
@@ -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));
@@ -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",