summaryrefslogtreecommitdiff
path: root/isisd/isis_adjacency.c
AgeCommit message (Collapse)Author
2025-04-08isisd: clean up -Wshadow warningsMark Stapp
Clean up various "shadow" warnings. Signed-off-by: Mark Stapp <mjs@cisco.com>
2024-08-09isisd: fix memory handling in isis_adj_process_threeway()Mark Stapp
The adj_process_threeway() api may call the adj_state_change() api, which may delete the adj struct being examined. Change the signature so that callers pass a ptr-to-ptr so that they will see that deletion. Signed-off-by: Mark Stapp <mjs@cisco.com>
2024-07-09Merge pull request #16241 from zhou-run/202406191740Russ White
isisd: The neighbor entry still displays the deleted hostname of the neighbor.
2024-07-08isisd: The neighbor entry still displays the deleted hostname of the neighborzhou-run
1. The lsp_update_data() function will check for the presence of the ISIS_TLV_DYNAMIC_HOSTNAME in the LSP, and then call isis_dynhn_insert() to add a hostname entry corresponding to the LSP ID. However, when the ISIS_TLV_DYNAMIC_HOSTNAME is not present in the LSP, the hostname entry corresponding to the LSP ID should also be deleted. 2. The command “show isis neighbor” invokes isis_adj_name() to display the System ID or hostname, but it does not check the area->dynhostname flag. 3. When the LSP expires and is removed, the corresponding hostname entry should also be deleted. 4. The TLV for LSP fragmentation will not contain the hostname and should be skipped. Signed-off-by: zhou-run <zhou.run@h3c.com>
2024-07-02Merge pull request #15716 from zhou-run/202404092101Russ White
isisd: Fix memory leaks when the transition of neighbor state from non-UP to DOWN
2024-05-23isisd: Fix memory leaks when the transition of neighbor state from non-UP to ↵zhou-run
DOWN When receiving a hello packet, if the neighbor state transitions directly from a non-ISIS_ADJ_UP state (such as ISIS_ADJ_INITIALIZING) to ISIS_ADJ_DOWN state, the neighbor entry cannot be deleted. If the neighbor is removed or the neighbor's System ID changes, it may result in memory leakage in the neighbor entry. Test Scenario: LAN link between Router A and Router B is established. Router A does not configure neighbor authentication, while Router B is configured with neighbor authentication. When the neighbor entry on Router B ages out, the neighbor state on Router A transitions to INIT. If Router B is then removed, the neighbor state on Router A transitions to DOWN and persists. Signed-off-by: zhou-run <166502045+zhou-run@users.noreply.github.com> fix frrbot styling issues found. fix frrbot styling issues found. Signed-off-by: zhou-run <166502045+zhou-run@users.noreply.github.com>
2024-05-03isisd: adjust the format of display commandanlan_cs
Before: ``` anlan# show isis neighbor Area xx: System Id Interface L State Holdtime SNPA 0023.0000.0000 enp1s0 2 Down Expiring2c53.4a30.0820 ``` After: ``` anlan# show isis neighbor Area xx: System Id Interface L State Holdtime SNPA 0023.0000.0000 enp1s0 2 Down Expiring 2c53.4a30.0820 ``` The `-` display format caused by no hello packet in `isis_adj_print_vty()` is same as that of above "Expiring". Signed-off-by: anlan_cs <anlan_cs@tom.com>
2024-04-04isisd: fix mispelling with ISIS_SR_LAN_BACKUPPhilippe Guibert
The ISIS_SR_LAN_BACKUP should be renamed to ISIS_SR_ADJ_BACKUP. Fixes: 26f6acafc369 ("isisd: add support for segment routing") Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-09-11isisd: Extend IS-IS adjacency with SRv6 adj SIDsCarmine Scarpitta
Initialize/remove SRv6 SIDs list when an IS-IS adjacency is created/deleted. Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-04-11Merge pull request #12698 from Orange-OpenSource/isisdRuss White
Isisd/Lib: Add new printfrr format facility for Intermediate System ID
2023-03-24*: Convert event.h to frrevent.hDonald Sharp
We should probably prevent any type of namespace collision with something else. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
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_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-24*: Rename thread.[ch] to event.[ch]Donald Sharp
This is a first in a series of commits, whose goal is to rename the thread system in FRR to an event system. There is a continual problem where people are confusing `struct thread` with a true pthread. In reality, our entire thread.c is an event system. In this commit rename the thread.[ch] files to event.[ch]. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-21isisd: Update to the new printfrr ISO formatOlivier Dugeon
This path replaces isisd_format_id, sysid_print, snpa_print, rawlspid_print and isonet_print functions by the new printfrr ISO System ID & Network Address format facilities. It also updates the isisd code to the new iso_address structure defined in lib/iso.h Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
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-31isisd: Add missing enum's to switch statementDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-10-24isisd: avoid fast-reroute on down adjacency when the interface is downLouis Scalbert
When an IS-IS interface is coming down, fast-reroute may be triggered twice: a first time after the detection of the interface down event and a second time after the detection of the adjacency down (because of the expiration of the ISIS Hello or BFD timers). Avoid a BFD down event from running fast-reroute another time if the interface was already detected down. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-10-24isisd: apply fast-reroute on an adjacency failureLouis Scalbert
When a adjacency falls down, the primary routes are not deleted on the dataplane until the SPF is recomputed. Even the backup routes are pre-installed on the dataplane, there is no fast-route optimization. Reasons for an adjacency to come down are: - BFD down - Hello timer timeout - User adjacency clear Apply the backup route switchover for fast-reroute as soon an IS-IS adjacency falls down before the first SPF re-computation. Pre-computed backup routes are applied sooner. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-08-29isisd: changes for code maintainabilitysri-mohan1
these changes are for improving the code maintainability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2022-07-28isisd: Prevent leak of global_ipv6_addrsDonald Sharp
adj->global_ipv6_addrs was not being freed on deletion of the adjacency. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-21isisd: Convert thread_cancel to THREAD_OFFDonald Sharp
Just convert all uses of thread_cancel to THREAD_OFF Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-10Revert "isisd: apply fast-reroute on an adjacency failure"Donatas Abraitis
This reverts commit 71252973234e70ffa3cb5eec43d4efc1be3d3331.
2022-07-10Revert "isisd: avoid fast-reroute on down adjacency when the interface is down"Donatas Abraitis
This reverts commit 08e4960ab48c1c9e4227e40b286d5cbc4ac581f0.
2022-05-24isisd: avoid fast-reroute on down adjacency when the interface is downLouis Scalbert
When an IS-IS interface is coming down, fast-reroute may be triggered twice: a first time after the detection of the interface down event and a second time after the detection of the adjacency down (because of the expiration of the ISIS Hello or BFD timers). Avoid a BFD down event from running fast-reroute another time if the interface was already detected down. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-05-23isisd: apply fast-reroute on an adjacency failureLouis Scalbert
When a adjacency falls down, the primary routes are not deleted on the dataplane until the SPF is recomputed. Even the backup routes are pre-installed on the dataplane, there is no fast-route optimization. Reasons for an adjacency to come down are: - BFD down - Hello timer timeout - User adjacency clear Apply the backup route switchover for fast-reroute as soon an IS-IS adjacency falls down before the first SPF re-computation. Pre-computed backup routes are applied sooner. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-04-08isisd: add bfd information on isis neighbor show commandPhilippe Guibert
Add bfd information on show isis neighbor command. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-03-08Merge pull request #10701 from rampxxxx/feat_isis_json_show_cmdsRuss White
Feat isis json show cmds
2022-03-01isisd: Add json to show isis neighbor command.Javier Garcia
Signed-off-by: Javier Garcia <javier.martin.garcia@ibm.com>
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-01-18Merge pull request #9938 from Orange-OpenSource/isis_lsRuss White
isisd: Add Link State Traffic Engineering support
2021-12-14isisd: fix use after freeIgor Ryzhov
Pointers to the adjacency must be cleared only when the adjacency is deleted. Otherwise, when the ISIS router is deleted later, the adjacency is not deleted and a crash happens because of UAF. Fixes #10209. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-11-30isisd: Add support for RFC6119 (IPv6 TE in IS-IS)Olivier Dugeon
- Add advertisement of Global IPv6 address in IIH pdu - Add new CLI to set IPv6 Router ID - Add advertisement of IPv6 Router ID - Correctly advertise IPv6 local and neighbor addresses in Extended IS and MT Reachability TLVs - Correct output of Neighbor IPv6 address in 'show isis database detail' - Manage IPv6 addresses advertisement and corresponiding Adjacency SID when IS-IS is not using Multi-Topology by introducing a new ISIS_MT_DISABLE value for mtid (== 4096 i.e. first reserved flag set to 1) Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2021-11-11isisd: use time_t for last update and last flapIgor Ryzhov
These variables are only assigned with time() which returns time_t. This should also fix occasional CI build failures because of comparisons of signed and unsigned integers. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-06-11isisd: per-instance dynamic hostname cacheIgor Ryzhov
Currently, the dynamic hostname cache is global. It is incorrect because neighbors in different VRFs may have the same system ID and different hostnames. This also fixes a memory leak - when the instance is deleted, the cache must be cleaned up and the cleanup thread must be cancelled. Fixes #8832. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-03-22isisd: kill isis_memory.h, use MTYPE_STATICDavid Lamparter
Convert most DEFINE_MTYPE into the _STATIC variant, and move the remaining non-static ones to appropriate places. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-22Merge pull request #8121 from opensourcerouting/macro-cleanupDonatas Abraitis
*: require ISO C11 + semicolons after file-scope macros
2021-03-18isisd: fix BFD session when IPv6 not configuredEmanuele Di Pascale
A wrong check was silently skipping the initialization of the bfd_session struct in the adjacency if the router was not configured for IPv6. This would cause BFD events to be ignored regardless of the configuration. Also add a function to return the "name" of an adjacency and use it in a couple of places, including the new log, instead of repeating the same code in a bunch of places. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2021-03-17*: require semicolon after DEFINE_HOOK & co.David Lamparter
See previous commit. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-02isisd: support for snmplynne
Add support for read only mib objects from RFC4444. Signed-off-by: Lynne Morrison <lynne@voltanet.io> Signed-off-by: Karen Schoener <karen@voltanet.io>
2020-10-23*: unify thread/event cancel macrosMark Stapp
Replace all lib/thread cancel macros, use thread_cancel() everywhere. Only the THREAD_OFF macro and thread_cancel() api are supported. Also adjust thread_cancel_async() to NULL caller's pointer (if present). Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-10-22isisd: replace inet_ntoaMark Stapp
Replace use of inet_ntoa, using pI4 Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-09-25isisd: guard against adj timer display overflowEmanuele Di Pascale
An adjacency should be removed when the holdtimer expires, but if the system is overloaded we may end up doing it late. In the meanwhile vtysh will display an incorrect value in the show isis neighbor output, due to an overflow of the unsigned variable used to display the Holdtime, e.g.: pe1# show isis neighbor Area test: System Id Interface L state Holdtime SNPA Spirent-1 2.201 1 Down 26 2020.2020.2020 Spirent-1 2.203 1 Up 21 2020.2020.2020 Spirent-1 2.204 1 Up 18446744073709551615 2020.2020.2020 Spirent-1 2.207 1 Up 18446744073709551615 2020.2020.2020 Spirent-1 2.208 1 Up 18446744073709551615 2020.2020.2020 Spirent-1 2.209 1 Up 0 2020.2020.2020 Spirent-1 2.210 1 Up 18446744073709551615 2020.2020.2020 pe2 12.200 1 Up 30 2020.2020.2020 Guard against that by printing an "Expiring" message instead. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2020-09-25isisd: simplify adj_change hook callEmanuele Di Pascale
There is no need to call isis_adj_state_change_hook once per level in isis_adj_state_change, we can just do it once at the end. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2020-08-26isisd: reuse adjacency state change hook in the SPF codeRenato Westphal
This is mostly a cosmetic change to make the code more modular, more elegant and easier to understand. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-08-14isisd : Transformational changes to support different VRFs.Kaushik
1. Created a structure "isis master". 2. All the changes are related to handle ISIS with different vrf. 3. A new variable added in structure "isis" to store the vrf name. 4. The display commands for isis is changed to support different VRFs. Signed-off-by: Kaushik <kaushik@niralnetworks.com>
2020-08-11isisd: introduce per-area list of IS-IS adjacenciesRenato Westphal
This should simplify all code that needs to iterate over all adjacencies of a given area (iterating over all adjacencies of all circuits is cumbersome). While here, repurpose isis_adj_exists() into a lookup function, making it more generally useful. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-07-03isisd: Fast RIB recovery from BFD recognized link failuresGalaxyGorilla
Unfortunately as the topotests show a fast recovery after failure detection due to BFD is currently not possible because of the following issue: There are multiple scheduling mechanisms within isisd to prevent overload situations. Regarding our problem these two are important: * scheduler for regenerating ISIS Link State PDUs scheduler for managing * consecutive SPF calculations In fact both schedulers are coupled, the first one triggers the second one, which again is triggered by isis_adj_state_change (which again is triggered by a BFD 'down' message). The re-calculation of SPF paths finally triggers updates in zebra for the RIB. Both schedulers work as a throttle, e.g. they allow the regeneration of Link State PDUs or a re-calculation for SPF paths only once within a certain time interval which is configurable (and by default different!). This means that a request can go through the first scheduler but might still be 'stuck' at the second one for a while. Or a request can be 'stuck' at the first scheduler even though the second one is ready. This also explains the 'random' behaviour one can observe testing since a 'fast' recovery is only possible if both schedulers are ready to process this request. Note that the solution in this commit is 'thread safe' in the sense that both schedulers use the same thread master such that the introduced flags are only used exactly one time (and one after another) for a 'fast' execution. Further there are some irritating comments and logs which I partially removed. They seems to be not valid anymore due to changes in thread management (or they were never valid in the first place). Signed-off-by: GalaxyGorilla <sascha@netdef.org>
2020-07-01isisd: log adj change when circuit goes downEmanuele Di Pascale
if we shutdown an interface isisd will delete the adjacencies on the corresponding circuit, but it will not log the change. Fix it to make sure that each change is logged. Also specify the level of the adjacency in the log message, while we are at it. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>