From: Igor Ryzhov Date: Thu, 7 Oct 2021 15:27:29 +0000 (+0300) Subject: bgpd: fix crash when using "show bgp vrf all" X-Git-Tag: frr-8.1-rc2~7^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=refs%2Fpull%2F9786%2Fhead;p=mirror%2Ffrr.git bgpd: fix crash when using "show bgp vrf all" Any command that uses `peer_lookup_in_view` crashes when "vrf all" is used, because bgp is NULL in this case. Signed-off-by: Igor Ryzhov (cherry picked from commit 1c49e8138ee377692d8b683fc4bfe292f77b5004) --- diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 925af80cb7..57083440b1 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -7883,8 +7883,7 @@ struct peer *peer_lookup_in_view(struct vty *vty, struct bgp *bgp, json_no, JSON_C_TO_STRING_PRETTY)); json_object_free(json_no); } else - vty_out(vty, "No such neighbor in %s\n", - bgp->name_pretty); + vty_out(vty, "No such neighbor in this view/vrf\n"); return NULL; } diff --git a/tests/topotests/all_protocol_startup/test_all_protocol_startup.py b/tests/topotests/all_protocol_startup/test_all_protocol_startup.py index 1b99fcea1f..ddb7f4e16e 100644 --- a/tests/topotests/all_protocol_startup/test_all_protocol_startup.py +++ b/tests/topotests/all_protocol_startup/test_all_protocol_startup.py @@ -966,7 +966,7 @@ def test_bgp_summary(): r"(192.168.7.(1|2)0|fc00:0:0:8::2000).+Active.+", "", expected ) elif "10.0.0.1" in arguments: - expected = "No such neighbor in VRF default" + expected = "No such neighbor in this view/vrf" if "terse" in arguments: expected = re.sub(r"BGP table version .+", "", expected)