From: Don Slice Date: Mon, 18 Jul 2016 14:32:46 +0000 (-0400) Subject: bgpd: Use the correct bgp instance for cli commands issuing clear X-Git-Tag: frr-2.0-rc1~462 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=849144993d13bae68f8eccf45c677e4a78e153bd;p=matthieu%2Ffrr.git bgpd: Use the correct bgp instance for cli commands issuing clear Some bgp commands end with doing a bgp_clear_vty, which invalidly made the assumption that the clear should always be done for the default instance. This fix derives the correct instance from the vty-index if one is supplied, and uses the default instance if it is not. Ticket: CM-10113 Signed-off-by: Don Slice Reviewed-by: Donald Sharp --- diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 5a9d431d2e..c429623e7e 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -523,7 +523,7 @@ bgp_clear_vty (struct vty *vty, const char *name, afi_t afi, safi_t safi, } else { - bgp = bgp_get_default (); + bgp = (vty->index) ? vty->index : bgp_get_default (); if (bgp == NULL) { vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);