]> git.puffer.fish Git - matthieu/frr.git/commit
bgpd: fix incorrect json in bgp_show_table_rd
authorLouis Scalbert <louis.scalbert@6wind.com>
Wed, 12 Feb 2025 11:50:42 +0000 (12:50 +0100)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Wed, 12 Feb 2025 20:11:03 +0000 (20:11 +0000)
commit7fce0f557dc630e150b03bcb9fb8ee4a58d32ae0
treed6127804d81199a2fb9d054596b061e4d5a06ba2
parent07e44e0aadcf9afccb25b7911a9eeea841aa979f
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>
(cherry picked from commit cf0269649cdd09b8d3f2dd8815caf6ecf9cdeef9)
bgpd/bgp_route.c