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
}
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);