From 7636bcc76565a5791a3acf4b6aa2605e2221e700 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Thu, 3 Aug 2023 22:00:27 +0300 Subject: [PATCH] bgpd: Check if we have such a peer before handling software capability Do not pass NULL for peer_established(), just in case. Signed-off-by: Donatas Abraitis --- bgpd/bgp_vty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 7464e99d48..591e0c3969 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -5728,8 +5728,8 @@ DEFPY(neighbor_capability_software_version, int ret; peer = peer_and_group_lookup_vty(vty, neighbor); - if (peer && peer->conf_if) - return CMD_SUCCESS; + if (!peer) + return CMD_WARNING_CONFIG_FAILED; if (no) ret = peer_flag_unset_vty(vty, neighbor, -- 2.39.5