]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: fix crash when using "show bgp vrf all"
authorIgor Ryzhov <iryzhov@nfware.com>
Thu, 7 Oct 2021 15:27:29 +0000 (18:27 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Fri, 8 Oct 2021 08:42:13 +0000 (11:42 +0300)
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 <iryzhov@nfware.com>
bgpd/bgpd.c
tests/topotests/all_protocol_startup/test_all_protocol_startup.py

index 925af80cb7901611ced7e82caa42a6c8b89c3581..57083440b16047b6c0bde0cdcbd9ca689ca57a83 100644 (file)
@@ -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;
        }
 
index 1b99fcea1f2518df23cca17f7752ab92c9bcf3f3..ddb7f4e16e219d1991187e24103362a8f7173cd9 100644 (file)
@@ -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)