From 7cca84df70045dfc203bbc75890fdd62e2e241be Mon Sep 17 00:00:00 2001 From: rgirada Date: Tue, 20 Jul 2021 04:39:05 -0700 Subject: [PATCH] ospfd: ospfd crash while giving 'clear ip ospf neighbor' Description: Ospf process crashes upon giving 'clear ip ospf neighbor' with self routerId. It is asserting if it is a self neighbor in ospf neighbour kill event processing. Added a check to validate the provided router-id is self router-id. Signed-off-by: Rajesh Girada (cherry picked from commit c88ad8ec5b309132b6319fd5677e427d5d8ac12c) --- ospfd/ospf_vty.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 54ce248d89..a3e7e49d3d 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -11383,6 +11383,11 @@ DEFPY (clear_ip_ospf_neighbor, if (!ospf->oi_running) continue; + if (nbr_id_str && IPV4_ADDR_SAME(&ospf->router_id, &nbr_id)) { + vty_out(vty, "Self router-id is not allowed.\r\n "); + return CMD_SUCCESS; + } + ospf_neighbor_reset(ospf, nbr_id, nbr_id_str); } -- 2.39.5