mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 11:18:43 +00:00
bgpd: fix incorrect json in bgp_show_table_rd
In bgp_show_table_rd(), the is_last argument is determined using the
expression "next == NULL" to check if the RD table is the last one. This
helps ensure proper JSON formatting.
However, if next is not NULL but is no longer associated with a BGP
table, the JSON output becomes malformed.
Updates the condition to also verify the existence of the next bgp_dest
table.
Fixes: 1ae44dfcba
("bgpd: unify 'show bgp' with RD with normal unicast bgp show")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
This commit is contained in:
parent
d275f551c3
commit
cf0269649c
@ -12436,10 +12436,9 @@ int bgp_show_table_rd(struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
|
|||||||
|
|
||||||
memcpy(&prd, dest_p, sizeof(struct prefix_rd));
|
memcpy(&prd, dest_p, sizeof(struct prefix_rd));
|
||||||
prefix_rd2str(&prd, rd, sizeof(rd), bgp->asnotation);
|
prefix_rd2str(&prd, rd, sizeof(rd), bgp->asnotation);
|
||||||
bgp_show_table(vty, bgp, afi, safi, itable, type, output_arg,
|
bgp_show_table(vty, bgp, afi, safi, itable, type, output_arg, rd,
|
||||||
rd, next == NULL, &output_cum,
|
!bgp_dest_get_bgp_table_info(next), &output_cum, &total_cum,
|
||||||
&total_cum, &json_header_depth,
|
&json_header_depth, show_flags, RPKI_NOT_BEING_USED);
|
||||||
show_flags, RPKI_NOT_BEING_USED);
|
|
||||||
if (next == NULL)
|
if (next == NULL)
|
||||||
show_msg = false;
|
show_msg = false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user