Commit Graph

17 Commits

Author SHA1 Message Date
Donald Sharp
cc9f21da22 *: Change thread->func to return void instead of int
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>
2022-02-23 19:56:04 -05:00
Donatas Abraitis
c48349e346 *: Remove redundand braces for single statement blocks
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-27 11:20:59 +02:00
Donatas Abraitis
5a6c232bf8 ospf6d: Convert vty_out to vty_json for JSON
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-25 17:50:37 +02:00
rgirada
6d1a5a1c54 ospf6d: Addressing few coverity issues.
Description:
	Addressed the following TAINTED_SCALAR issue which can possibly
	leads to memory currption.

	1. *** CID 1506514:  Insecure data handling  (TAINTED_SddddddCALAR)
	   /ospf6d/ospf6_gr_helper.c: 1222 in ospf6_grace_lsa_show_info()

	2. *** CID 1506513:  Insecure data handling  (TAINTED_SCALAR)
	   /ospf6d/ospf6_gr_helper.c: 160 in ospf6_extract_grace_lsa_fields()

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2021-10-29 11:04:06 -07:00
Donatas Abraitis
d573b8f863 ospf6d: Do not explicitly set the thread pointer to NULL
FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics.  This is espacially true for the functions we
end up calling the thread for.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-10-08 08:56:42 +03:00
Renato Westphal
6b513b4c92 ospf6d: rename the "graceful-restart helper-only" command
Considering that both the GR helper mode and restarting mode can be
enabled at the same time, the "graceful-restart helper-only" command
can be a bit misleading since it implies that only the helper mode
is enabled. Rename the command to "graceful-restart helper enable"
to clarify what the command does.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-09-21 11:51:36 -03:00
Renato Westphal
7116509803 ospf6d: introduce support for Graceful Restart (restarting mode)
RFC 5187 specifies the Graceful Restart enhancement to the OSPFv3
routing protocol. This commit implements support for the GR
restarting mode.

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 ipv6
  ospf` EXEC-level command needs to be issued before restarting the
  ospf6d 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 ospf6d 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.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-09-16 12:26:48 -03:00
Igor Ryzhov
390dce1275 ospf6d: fix possible NULL dereference
OSPF6_CMD_CHECK_RUNNING doesn't check that ospf6 is not NULL.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-09-15 13:48:29 +03:00
Renato Westphal
3ebc5e4be9 ospf6d: fix display of debug command in the running configuration
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-08-31 01:48:22 -03:00
Mark Stapp
ea5e814cf7
Merge pull request #9457 from anlancs/ospf6-void
ospf6d: suppress coverity warning of return value
2021-08-24 15:30:45 -04:00
anlan_cs
37692712a5 ospf6d: fix lock leak of using ALL_LSDB in GR helper
The lsa and lsanext must be unlocked if break out of ALL_LSDB loop.

Incidentally correct the comment of ALL_LSDB.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2021-08-22 05:26:20 -04:00
anlan_cs
4d97dde2d1 ospf6d: suppress coverity warning of return value
Fix #CID 1506511

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2021-08-21 22:04:12 -04:00
rgirada
0fc3e11323 ospf6d: GR helper configurations
Description:
	Adding the following cli commands to enable/disable GR helper
	functionality.
	1. [no] graceful-restart helper-only [A.B.C.D]
	2. [no] graceful-restart helper lsa-check-disable
	3. [no] graceful-restart helper planned-only
	4. [no] graceful-restart helper supported-grace-time (10-1800)

	show commands:
	show ipv6 ospf6 graceful-restart helper [detail] [json]

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2021-08-11 23:06:49 -07:00
rgirada
9a06f23d0b ospf6d: GR helper exit scenarios
Description:
	Changes to cover all the following  GR helper exit scenarios.
	1. Upon receiving max age grace lsa.( successful graceful restart)
	2. Topo change
	3. Grace timer expiry.
	4. User changes( like config deletion , interface down)

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2021-08-10 02:57:23 -07:00
rgirada
0d1753a7db ospf6d: Helper functionality changes
Description:
	1. changes to process GRACE LSA packet.
	2. Validation changes to enter Helper role.
	3. Helper functionality during graceful restart.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2021-08-10 02:57:23 -07:00
rgirada
0694366601 ospf6d: debug command support for helper support.
Description:
	Adding debug support for helper functionality.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2021-08-10 02:57:23 -07:00
rgirada
59790f521a ospf6d: Init/De-init gr helper functionality
Description:
	Graceful restart helper functionality initialisation and deinit apis.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2021-08-10 02:57:23 -07:00