summaryrefslogtreecommitdiff
path: root/isisd/isis_bfd.c
AgeCommit message (Collapse)Author
2023-03-24*: Convert `struct event_master` to `struct event_loop`Donald Sharp
Let's find a better name for it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert struct thread_master to struct event_master and it's ilkDonald Sharp
Convert the `struct thread_master` to `struct event_master` across the code base. Signed-off-by: Donald Sharp <sharpd@nvidia.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>
2022-06-28Merge pull request #11434 from donaldsharp/more_test_fixupsIgor Ryzhov
Crash fix and test fix and some cleanup
2022-06-23isisd: Fix crash with xfrm interface typeDonald Sharp
When creating a xfrm interface FRR is crashing when configured with isis. This is because the weird pattern of not allocating list's until needed and then allowing the crash when we have a usage pattern that was not expected. Just always allocate the different lists that a circuit needs. (gdb) bt (gdb) Fixes #11432 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-23isisd: Let's use an actual NULL pointer to test for a NULL pointerDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-31isisd: prevent from accessing a non initialised pointerPhilippe Guibert
When using bfd on a single level, one may access a null pointer list. Prevent from using it. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.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-22*: cleanup ifp->vrf_idIgor Ryzhov
Since f60a1188 we store a pointer to the VRF in the interface structure. There's no need anymore to store a separate vrf_id field. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-31isisd, ospf6d, pimd: set vrf_id when creating bfd sessionsIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-07isisd: rework BFD integrationIgor Ryzhov
Rewrite the BFD integration code to use the new library. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-03-22Merge pull request #8121 from opensourcerouting/macro-cleanupDonatas Abraitis
*: require ISO C11 + semicolons after file-scope macros
2021-03-18isisd: add debug logs to troubleshoot BFD issuesEmanuele Di Pascale
when we receive an event from BFDD and we end up throwing it away, make sure that we log (with debug guards) the reason for this, so we can troubleshoot issues like the one addressed by the previous commit. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
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_MTYPE & coDavid Lamparter
Back when I put this together in 2015, ISO C11 was still reasonably new and we couldn't require it just yet. Without ISO C11, there is no "good" way (only bad hacks) to require a semicolon after a macro that ends with a function definition. And if you added one anyway, you'd get "spurious semicolon" warnings on some compilers... With C11, `_Static_assert()` at the end of a macro will make it so that the semicolon is properly required, consumed, and not warned about. Consistently requiring semicolons after "file-level" macros matches Linux kernel coding style and helps some editors against mis-syntax'ing these macros. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-02-07*: Fix usage of bfd_adj_eventDonald Sharp
Valgrind reports: 469901-==469901== 469901-==469901== Conditional jump or move depends on uninitialised value(s) 469901:==469901== at 0x3A090D: bgp_bfd_dest_update (bgp_bfd.c:416) 469901-==469901== by 0x497469E: zclient_read (zclient.c:3701) 469901-==469901== by 0x4955AEC: thread_call (thread.c:1684) 469901-==469901== by 0x48FF64E: frr_run (libfrr.c:1126) 469901-==469901== by 0x213AB3: main (bgp_main.c:540) 469901-==469901== Uninitialised value was created by a stack allocation 469901:==469901== at 0x3A0725: bgp_bfd_dest_update (bgp_bfd.c:376) 469901-==469901== 469901-==469901== Conditional jump or move depends on uninitialised value(s) 469901:==469901== at 0x3A093C: bgp_bfd_dest_update (bgp_bfd.c:421) 469901-==469901== by 0x497469E: zclient_read (zclient.c:3701) 469901-==469901== by 0x4955AEC: thread_call (thread.c:1684) 469901-==469901== by 0x48FF64E: frr_run (libfrr.c:1126) 469901-==469901== by 0x213AB3: main (bgp_main.c:540) 469901-==469901== Uninitialised value was created by a stack allocation 469901:==469901== at 0x3A0725: bgp_bfd_dest_update (bgp_bfd.c:376) On looking at bgp_bfd_dest_update the function call into bfd_get_peer_info when it fails to lookup the ifindex ifp pointer just returns leaving the dest and src prefix pointers pointing to whatever was passed in. Let's do two things: a) The src pointer was sometimes assumed to be passed in and sometimes not. Forget that. Make it always be passed in b) memset the src and dst pointers to be all zeros. Then when we look at either of the pointers we are not making decisions based upon random data in the pointers. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-14isisd: if IS-IS is configured for v6, prefer v6 bfd sessionsKaren Schoener
Signed-off-by: Lynne Morrison <lynne@voltanet.io> Signed-off-by: Karen Schoener <karen@voltanet.io>
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-07-10isisd: lib: refactor ISIS BFD APIGalaxyGorilla
Use `zclient_bfd_command` instead of `bfd_peer_sendmsg`. Signed-off-by: GalaxyGorilla <sascha@netdef.org>
2020-07-10 *: add BFD profile support for IS-ISGalaxyGorilla
BFD profiles can now be used on the interface level like this: interface eth1 ip router isis 1 isis bfd isis bfd profile default Here the 'default' profile needs to be specified as usual in the bfdd configuration. Signed-off-by: GalaxyGorilla <sascha@netdef.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-02Merge pull request #6437 from opensourcerouting/bfd-profiles-bgpDonald Sharp
bfdd,bgpd: profiles integration support
2020-06-24ISIS VRF: ISIS Debug structure modificationsharios
1. The "isis->debug" variable dependency on debug logs print is removed. Signed-off-by: harios <hari@niralnetworks.com>
2020-05-31isisd: check interface pointer before accessingRafael Zalamena
On some cases (protocol convergence down or daemon exit) we'll have the interface pointer in the circuit as `NULL`, so don't attempt to access it. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-04-23isisd: fix display of "isis bfd" in the running configurationRenato Westphal
Since this command is modeled using YANG, it's already displayed as part of the call to nb_cli_show_dnode_cmds(). Calling the 'isis_circuit_config_write' hook was only making that command to be displayed twice. The aforementioned hook is still necessary for fabricd, which wasn't converted to the new northbound model yet. Fixes #6281. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-18isisd: Prevent use after free for isis_adj_state_changeDonald Sharp
When we call isis_adj_state_change with ISIS_ADJ_DOWN we free the pointer, but we were still using the pointer after it was freed. Cleanup the api to prevent this. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-03*: don't null after XFREE; XFREE does this itselfQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-10-28bfdd: Handling local and remote admin-downSumitAgarwal123
Scenarios where this code change is required: 1. BFD is un-configured from BGP at remote end. Neighbour BFD sends ADMIN_DOWN state, but BFD on local side will send DOWN to BGP, resulting in BGP session DOWN. Removing BFD session administratively shouldn't bring DOWN BGP session at local or remote. 2. BFD is un-configured from BGP or shutdown locally. BFD will send state DOWN to BGP resulting in BGP session DOWN. (This is akin to saying do not use BFD for BGP) Removing BFD session administratively shouldn't bring DOWN BGP session at local or remote. Signed-off-by: Sayed Mohd Saquib sayed.saquib@broadcom.com
2019-08-22isisd: add support for IPv6 BFD peersRenato Westphal
Make isisd create BFD sessions over IPv6 when IS-IS is configured for IPv6 operation only. When IS-IS is enabled for both IPv4 and IPv6 on a given interface, prefer creating a BFD session over IPv6 to avoid having two BFD sessions protecting the same IS-IS adjacency. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-05-14bfdd, lib, bgpd: add bfd cbit usagePhilippe Guibert
bfd cbit is a value carried out in bfd messages, that permit to keep or not, the independence between control plane and dataplane. In other words, while most of the cases plan to flush entries, when bfd goes down, there are some cases where that bfd event should be ignored. this is the case with non stop forwarding mechanisms where entries may be kept. this is the case for BGP, when graceful restart capability is used. If BFD event down happens, and bgp is in graceful restart mode, it is wished to ignore the BFD event while waiting for the remote router to restart. The changes take into account the following: - add a config flag across zebra layer so that daemon can set or not the cbit capability. - ability for daemons to read the remote bfd capability associated to a bfd notification. - in bfdd, according to the value, the cbit value is set - in bfdd, the received value is retrived and stored in the bfd session context. - by default, the local cbit announced to remote is set to 1 while preservation of the local path is not set. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-05-07bgp, ospfd, ospf6d, pimd, lib, isisd: add bfd_client_sendmsg vrf_idPhilippe Guibert
vrf_id parameter is added to the api of bfd_client_sendmsg(). this permits being registered to bfd from a separate vrf. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-05-03*: use ZAPI_CALLBACK_ARGS macro for zapi handlersQuentin Young
This macro: - Marks ZAPI callbacks for readability - Standardizes argument names - Makes it simple to add ZAPI arguments in the future - Ensures proper types - Looks better - Shortens function declarations Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-10-12isisd: Fix license header of bfd codeChristian Franke
2018-10-12isisd: Address code-style warningsChristian Franke
2018-10-09isisd: don't add deprecated bfd commandChristian Franke
2018-10-05isisd: Track BFD state and take down adjacency on failureChristian Franke
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-10-05isisd: Add debugging for BFDChristian Franke
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-10-05isisd: Implement BFD replay functionChristian Franke
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-10-05isisd: Register/deregister BFD peers for adjacenciesChristian Franke
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-10-05isisd: Write BFD configChristian Franke
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-10-05isisd: Add BFD configuration commandsChristian Franke
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-10-05isisd: Register as BFD clientChristian Franke
Signed-off-by: Christian Franke <chris@opensourcerouting.org>