]> git.puffer.fish Git - matthieu/frr.git/commit
ospfd: fix deferred shutdown handling
authorRenato Westphal <renato@opensourcerouting.org>
Thu, 23 Nov 2023 23:23:52 +0000 (20:23 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Fri, 1 Dec 2023 11:53:30 +0000 (08:53 -0300)
commit3e2f053b12371c71d8f7c21a4df68d21d4682637
tree7744aaeb7231b33f4bed1ff4194102d3f8521dc4
parent37f861f1dbeda410c52d3b5f9f685e32a177211c
ospfd: fix deferred shutdown handling

The ospfd cleanup code is relatively complicated given the need to
appropriately handle the "max-metric router-lsa on-shutdown (5-100)"
command. When that command is configured and an OSPF instance is
unconfigured, the removal of the instance should be deferred to allow
other routers sufficient time to find alternate paths before the
local Router-LSAs are flushed. When ospfd is killed, however, deferred
shutdown shouldn't take place and all instances should be cleared
immediately.

This commit fixes a problem where ospf_deferred_shutdown_finish()
was prematurely exiting the daemon when no instances were left,
inadvertently preventing ospf_terminate() from clearing the ospfd
global variables. Additionally, the commit includes code refactoring
to enhance readability and maintainability.

Fixes #14855.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
ospfd/ospfd.c