summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_gr_helper.c
AgeCommit message (Collapse)Author
2024-05-31ospf6d: Prevent heap-buffer-overflow with unknown typeIggy Frankovic
When parsing a osf6 grace lsa field and we receive an unknown tlv type, ospf6d was not incrementing the pointer to get beyond the tlv. Leaving a situation where ospf6d would parse the packet incorrectly. Signed-off-by: Iggy Frankovic <iggy07@gmail.com> (cherry picked from commit 826f2510e67711045e52cf4b5e3ddef514ed556e)
2023-09-29*: Do not cast to the same type as the destination isDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-07-12ospf6d: Convert ospf6_lsa_unlock to a better apiDonald Sharp
Make the ospf6_lsa_unlock take the same parameters that the ospf_lsa_unlock does to make it consistent and to also ensure that no-one can make the mistake of getting the pointer cleared up. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-07ospf,ospf6: fix json key typo supoortMark Stapp
Fix json key 'supoort' -> 'support'; add 1-year deprecation notice; fix topotests to use corrected json key. Signed-off-by: Mark Stapp <mjs@labn.net>
2023-03-24*: Convert THREAD_XXX macros to EVENT_XXX macrosDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert thread_timer_remain_XXX to event_timer_remain_XXXDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert thread_add_XXX functions to event_add_XXXDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename `struct thread` to `struct event`Donald Sharp
Effectively a massive search and replace of `struct thread` to `struct event`. Using the term `thread` gives people the thought that this event system is a pthread when it is not Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-21*: Add a hash_clean_and_free() functionDonald Sharp
Add a hash_clean_and_free() function as well as convert the code to use it. This function also takes a double pointer to the hash to set it NULL. Also it cleanly does nothing if the pointer is NULL( as a bunch of code tested for ). Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-17ospfd, ospf6d: Add more logging detailsDonatas Abraitis
Basically just router-id or interface/IP. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-02-09*: auto-convert to SPDX License IDsDavid Lamparter
Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-01-31*: Drop deprecated incorrect JSON fields with wrong namingDonatas Abraitis
Deprecation cycle already passed. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-10-26build, vtysh: extract vtysh commands from .xrefDavid Lamparter
Rather than running selected source files through the preprocessor and a bunch of perl regex'ing to get the list of all DEFUNs, use the data collected in frr.xref. This not only eliminates issues we've been having with preprocessor failures due to nonexistent header files, but is also much faster. Where extract.pl would take 5s, this now finishes in 0.2s. And since this is a non-parallelizable build step towards the end of the build (dependent on a lot of other things being done already), the speedup is actually noticeable. Also files containing CLI no longer need to be listed in `vtysh_scan` since the .xref data covers everything. `#ifndef VTYSH_EXTRACT_PL` checks are equally obsolete. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-18ospf6d: adding missing json fieldsrgirada
Description: Active GR count field is missing in json o/p of 'show ipv6 ospf gr helper' command. Issue: #12100 Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2022-07-27ospf6d: corrected the debug stringsri-mohan1
Corrected the gramatical error for debug string Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2022-05-20ospf6d: Clean up thread interfaceDonald Sharp
a) Remove setting of thread pointer to NULL after thread invocation, this is already done. b) Use thread_is_scheduled() Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-05-10ospf6d: add header size check for LSAanlan_cs
Add header size check for safe. If the check fails, just jump out of current function. Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-05-03*: remove the checking returned value for hash_get()anlan_cs
Firstly, *keep no change* for `hash_get()` with NULL `alloc_func`. Only focus on cases with non-NULL `alloc_func` of `hash_get()`. Since `hash_get()` with non-NULL `alloc_func` parameter shall not fail, just ignore the returned value of it. The returned value must not be NULL. So in this case, remove the unnecessary checking NULL or not for the returned value and add `void` in front of it. Importantly, also *keep no change* for the two cases with non-NULL `alloc_func` - 1) Use `assert(<returned_data> == <searching_data>)` to ensure it is a created node, not a found node. Refer to `isis_vertex_queue_insert()` of isisd, there are many examples of this case in isid. 2) Use `<returned_data> != <searching_data>` to judge it is a found node, then free <searching_data>. Refer to `aspath_intern()` of bgpd, there are many examples of this case in bgpd. Here, <returned_data> is the returned value from `hash_get()`, and <searching_data> is the data, which is to be put into hash table. Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-03-13Merge pull request #10447 from ton31337/fix/json_with_whitespacesDonald Sharp
*: Fix JSON keys with whitespaces and PascalCase
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>
2022-02-03*: Add camelCase JSON keys in addition to PascalCaseDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-27*: Remove redundand braces for single statement blocksDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-25ospf6d: Convert vty_out to vty_json for JSONDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-10-29ospf6d: Addressing few coverity issues.rgirada
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-08ospf6d: Do not explicitly set the thread pointer to NULLDonatas Abraitis
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-09-21ospf6d: rename the "graceful-restart helper-only" commandRenato Westphal
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-16ospf6d: introduce support for Graceful Restart (restarting mode)Renato Westphal
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-15ospf6d: fix possible NULL dereferenceIgor Ryzhov
OSPF6_CMD_CHECK_RUNNING doesn't check that ospf6 is not NULL. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-08-31ospf6d: fix display of debug command in the running configurationRenato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-08-24Merge pull request #9457 from anlancs/ospf6-voidMark Stapp
ospf6d: suppress coverity warning of return value
2021-08-22ospf6d: fix lock leak of using ALL_LSDB in GR helperanlan_cs
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-21ospf6d: suppress coverity warning of return valueanlan_cs
Fix #CID 1506511 Signed-off-by: anlan_cs <anlan_cs@tom.com>
2021-08-11ospf6d: GR helper configurationsrgirada
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-10ospf6d: GR helper exit scenariosrgirada
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-10ospf6d: Helper functionality changesrgirada
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-10ospf6d: debug command support for helper support.rgirada
Description: Adding debug support for helper functionality. Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2021-08-10ospf6d: Init/De-init gr helper functionalityrgirada
Description: Graceful restart helper functionality initialisation and deinit apis. Signed-off-by: Rajesh Girada <rgirada@vmware.com>