From 8282ecff1785bfac02fa8791d130c76d4957a783 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Tue, 30 May 2017 08:30:57 -0300 Subject: [PATCH] bgpd: fix segfault with some show commands The following commands were causing bgpd to crash when vpnv4/vpnv6 static routes are configured: bgpd aborted: vtysh -c "show ip bgp view all ipv4 vpn json" bgpd aborted: vtysh -c "show ip bgp view all ipv4 vpn" bgpd aborted: vtysh -c "show ip bgp view all ipv6 vpn json" bgpd aborted: vtysh -c "show ip bgp view all ipv6 vpn" bgpd aborted: vtysh -c "show ip bgp vrf all ipv4 vpn json" bgpd aborted: vtysh -c "show ip bgp vrf all ipv4 vpn" bgpd aborted: vtysh -c "show ip bgp vrf all ipv6 vpn json" bgpd aborted: vtysh -c "show ip bgp vrf all ipv6 vpn" bgpd aborted: vtysh -c "show bgp view all ipv4 vpn json" bgpd aborted: vtysh -c "show bgp view all ipv4 vpn" bgpd aborted: vtysh -c "show bgp view all ipv6 vpn json" bgpd aborted: vtysh -c "show bgp view all ipv6 vpn" bgpd aborted: vtysh -c "show bgp vrf all ipv4 vpn json" bgpd aborted: vtysh -c "show bgp vrf all ipv4 vpn" bgpd aborted: vtysh -c "show bgp vrf all ipv6 vpn json" bgpd aborted: vtysh -c "show bgp vrf all ipv6 vpn" Problem found with the CLI fuzzer. Signed-off-by: Renato Westphal --- bgpd/bgp_route.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 7a328e79d7f4..fae7da881ad2 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -8071,7 +8071,6 @@ bgp_show_all_instances_routes_vty (struct vty *vty, afi_t afi, safi_t safi, { struct listnode *node, *nnode; struct bgp *bgp; - struct bgp_table *table; int is_first = 1; if (use_json) @@ -8097,9 +8096,7 @@ bgp_show_all_instances_routes_vty (struct vty *vty, afi_t afi, safi_t safi, ? "Default" : bgp->name, VTY_NEWLINE); } - table = bgp->rib[afi][safi]; - bgp_show_table (vty, bgp, table, - bgp_show_type_normal, NULL, use_json); + bgp_show (vty, bgp, afi, safi, bgp_show_type_normal, NULL, use_json); }