]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospfd: ospfd crash while giving 'clear ip ospf neighbor'
authorrgirada <rgirada@vmware.com>
Tue, 20 Jul 2021 11:39:05 +0000 (04:39 -0700)
committerrgirada <rgirada@vmware.com>
Tue, 20 Jul 2021 11:39:05 +0000 (04:39 -0700)
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 <rgirada@vmware.com>
ospfd/ospf_vty.c

index 2cb3ec0894bada8bb4c6289eb196be812ceb87d3..bf2a8564f095011d47cbee5629dba963d127cf61 100644 (file)
@@ -11389,6 +11389,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);
        }