]> git.puffer.fish Git - mirror/frr.git/commit
bgpd: Blank RD in "sh bgp l2vpn evpn all neighbors <ip> advertised-routes json" 5406/head
authorLakshman Krishnamoorthy <lkrishnamoor@vmware.com>
Thu, 21 Nov 2019 23:30:00 +0000 (15:30 -0800)
committerLakshman Krishnamoorthy <lkrishnamoor@vmware.com>
Thu, 21 Nov 2019 23:30:00 +0000 (15:30 -0800)
commitf5cfc290d3cc43be9f100846631afb0669020179
tree830828828c876322392bf3a2147ee1c663c4c295
parent2d7ef3bba7eeb00adf2aceeca4747b59f4ac5fc7
bgpd: Blank RD in "sh bgp l2vpn evpn all neighbors <ip> advertised-routes json"

Bug: While preparing the JSON output, 2 loops are traversed: the outer loop
loops through RD, and the inner loop loops through the prefixes of that RD.

We hit the bug (printing blank RD and stale or null prefix info) when the inner
loop exits with nothing to print, (without allocating json_routes) and the outer
loop still tries to attach it to the parent, json_adv. Thus, we have
key=<BLANK RD>, value=<junk or prev json_routes>

The fix: Avoid attaching json_routes to the parent json if there
is nothing to print.

Signed-off-by: Lakshman Krishnamoorthy <lkrishnamoor@vmware.com>
bgpd/bgp_vpn.c