From 10d5be75aa99fef20acca97c4441e18982f8dad9 Mon Sep 17 00:00:00 2001 From: Lakshman Krishnamoorthy Date: Tue, 12 Nov 2019 14:02:05 -0800 Subject: [PATCH] bgpd: Bug fix in "show bgp l2vpn evpn ... advertised-routes' The bug: As part of displaying advertised routes to a peer, in the outer loop, we iterate through all prefixes in the evpn table. In the inner loop, we iterate through adj_out of each prefix. If a prefix which is present in the evpn table is not advertised to a peer, its corresponding attr == NULL. Checking for this condition is the fix. Signed-off-by: Lakshman Krishnamoorthy --- bgpd/bgp_vpn.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bgpd/bgp_vpn.c b/bgpd/bgp_vpn.c index e48eda7231..f922d066c3 100644 --- a/bgpd/bgp_vpn.c +++ b/bgpd/bgp_vpn.c @@ -106,6 +106,9 @@ int show_adj_route_vpn(struct vty *vty, struct peer *peer, if (bgp_node_get_bgp_path_info(rm) == NULL) continue; + if (!attr) + continue; + if (header) { if (use_json) { json_object_int_add( -- 2.39.5