]> git.puffer.fish Git - mirror/frr.git/commit
ospfd: Fix for vitual-link crash in signal handler 13135/head
authorPooja Jagadeesh Doijode <pdoijode@nvidia.com>
Mon, 27 Mar 2023 17:31:00 +0000 (10:31 -0700)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Wed, 29 Mar 2023 04:19:40 +0000 (04:19 +0000)
commit2755893d5c61f64543f64dfd1b24ba9bfbf90f65
tree242ed43f247f3fdf77a451214f38e39b2a8bb405
parent7f92592633a5a91f3c200e4e03804286a286fbe8
ospfd: Fix for vitual-link crash in signal handler

Whenever OSPF virtual-link is created, a virtual interface is
associated with it. Name of the virtual interface is derived by
combining "VLINK" string with the value of vlink_count, which is a global
variable.

Problem:
Consider a scenario where 2 virtual links A and B are created in OSPF with
virtual interfaces VLINK0 and VLINK1 respectively. When virtual-link A is unconfigured
and reconfigured, new interface name derived for it will be VLINK1, which is already
associated with virtual-link B. Due to this, both virtual-links A and B will
point to the same interface, VLINK1.

During FRR restart when signal handler is called, OSPF goes through all the virtual
links and deletes the interface(oi) associated with it. During the deletion of interface
for virtual-link B,it accesses the interface which was deleted already(which was deleted
during deletion of virual-link A) and whose fields were set to NULL. This
leads to OSPF crash.

Fixed it by not decrementing vlink_count during unconfig/deletion for virtual-link.

Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
(cherry picked from commit 19f451913ed73810e4b02774eae37782c8c36f24)
ospfd/ospf_interface.c