summaryrefslogtreecommitdiff
path: root/ospfd/ospf_gr.c
AgeCommit message (Collapse)Author
2022-03-09ospfd,ospf6d: Add missing newline for `graceful-restart prepare` CLIDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-02-23*: Change thread->func to return void instead of intDonald Sharp
The int return value is never used. Modify the code base to just return a void instead. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-15ospfd: fix no-form of "graceful-restart" commandIgor Ryzhov
The no-form should use the same arguments as the regular command, hence replace "period" with "grace-period". Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-10-15Merge pull request #9813 from opensourcerouting/ospf-gr-fixesDonald Sharp
ospfd: more GR fixes
2021-10-12ospfd: introduce additional opaque capability check in the GR codeRenato Westphal
Before starting the graceful restart procedures, ospf_gr_prepare() verifies for each configured OSPF instance whether it has the opaque capability enabled (a pre-requisite for GR). If not, a warning is emitted and GR isn't performed on that instance. This PR introduces an additional opaque capability check that will return a CLI error when the opaque capability isn't enabled. The idea is to make it easier for the user to identify when the GR activation has failed, instead of requiring him or her to check the logs for errors. The original opaque capability check from ospf_gr_prepare() was retaining as it's possible that that function might be called from other contexts in the future. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-12ospfd: fix flushing of Grace-LSAs on broadcast interfacesRenato Westphal
The ospfd opaque LSA infrastruture has an issue where it can't store different versions of the same Type-9 LSA for different interfaces. When flushing the self-originated Grace-LSAs upon exiting from the GR mode, the code was looking up the single self-originated Grace-LSA from the LSDB, setting its age to MaxAge and sending it out on all interfaces. The problem is that Grace-LSAs sent on broadcast interfaces have their own unique "IP interface address" TLV that is used to identify the restarting router. That way, just reusing the same Grace-LSA for all interfaces doesn't work. Fix this by generating a new Grace-LSA with its age manually set to MaxAge whenever one needs to be flushed. This will allow the "IP interface address" TLV to be set correctly and make GR work even in the presence of multiple broadcast interfaces. In the long term, the opaque LSA infrastructure should be updated to support Type-9 link-local LSAs correctly so that we don't need to resort to hacks like this. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-09ospfd: use ospf_get_name() wherever possibleRenato Westphal
Small cleanup to reduce code duplication. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-07-05ospfd: introduce support for Graceful Restart (restarting mode)Renato Westphal
RFC 3623 specifies the Graceful Restart enhancement to the OSPF routing protocol. This PR implements support for the restarting mode, whereas the helper mode was implemented by #6811. This work is based on #6782, which implemented the pre-restart part and settled the foundations for the post-restart part (behavioral changes, GR exit conditions, and on-exit actions). Here's a quick summary of how the GR restarting mode works: * GR can be enabled on a per-instance basis using the `graceful-restart [grace-period (1-1800)]` command; * To perform a graceful shutdown, the `graceful-restart prepare ospf` EXEC-level command needs to be issued before restarting the ospfd daemon (there's no specific requirement on how the daemon should be restarted); * `graceful-restart prepare ospf` will initiate the graceful restart for all GR-enabled instances by taking the following actions: o Flooding Grace-LSAs over all interfaces o Freezing the OSPF routes in the RIB o Saving the end of the grace period in non-volatile memory (a JSON file stored in `$frr_statedir`) * Once ospfd is started again, it will follow the procedures described in RFC 3623 until it detects it's time to exit the graceful restart (either successfully or unsuccessfully). Testing done: * New topotest featuring a multi-area OSPF topology (including stub and NSSA areas); * Successful interop tests against IOS-XR routers acting as helpers. Co-authored-by: GalaxyGorilla <sascha@netdef.org> Signed-off-by: Renato Westphal <renato@opensourcerouting.org>