There exists a state where we may have a rd node but no individual
evpn prefix nodes in the two level table:
(gdb) bt
at bgpd/bgp_evpn_vty.c:1190
filter=FILTER_RELAXED) at lib/command.c:1060
at lib/command.c:1119
vtysh=vtysh@entry=0) at lib/command.c:1273
(gdb) f 5
at bgpd/bgp_evpn_vty.c:1190
1190 bgpd/bgp_evpn_vty.c: No such file or directory.
(gdb) p buf
$1 = "[2]:[0]:[48]:[00:00:00:00:00:00]", '\000' <repeats 240 times>...
(gdb) p json_nroute
$2 = (json_object *) 0x0
(gdb) p rd_header
$3 = 1
(gdb) p buf
$4 = "[2]:[0]:[48]:[00:00:00:00:00:00]", '\000' <repeats 240 times>...
(gdb)
I'm not entirely sure that this is not a `different` problem in that the
rd node should have been removed. But I think preventing the crash
in a show command is probably the right thing to do here.
Fixes: #4501
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
json_object_int_add(json_prefix_info,
"prefixLen", rm->p.prefixlen);
+
+ if (rd_header)
+ json_nroute = json_object_new_object();
}
for (pi = bgp_node_get_bgp_path_info(rm); pi;
else if (type == RD_TYPE_IP)
decode_rd_ip(pnt + 2, &rd_ip);
if (use_json) {
- json_nroute =
- json_object_new_object();
if (type == RD_TYPE_AS
|| type == RD_TYPE_AS4)
sprintf(rd_str, "%u:%d",
SAFI_EVPN, json_array);
output_count++;
}
+ rd_header = 0;
if (use_json) {
json_object_object_add(json_prefix_info,
"paths", json_array);