summaryrefslogtreecommitdiff
path: root/isisd/isis_circuit.c
AgeCommit message (Collapse)Author
2025-03-05isisd:IS-IS hello packets not sent with configured hello timerZ-Yivon
Signed-off-by: Z-Yivon <202100460108@mail.sdu.edn.cn>
2025-02-26fabricd: add option to treat dummy interfaces as loopback interfacesGabriel Goller
Enable dummy-interfaces to be used as router-id interfaces in openfabric networks. This allows multiple openfabric routers with different router-ids on a single node when using IP unnumbered setup (interfaces without IPs configured). Previously we were limited by having a single loopback interface, allowing only one openfabric router per node. Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
2025-02-05isisd: Do not leak a linked list in the circuitDonald Sharp
Address sanitizer was telling us that linked lists were being leaked. No need to do so. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-12-30isisd: Show correct level information for `show isis interface detail json`Donatas Abraitis
Having this configuration: ``` ! interface r1-eth0 ip address 10.0.0.1/30 ip router isis 1 isis priority 44 level-1 isis priority 88 level-2 isis csnp-interval 90 level-1 isis csnp-interval 99 level-2 isis psnp-interval 70 level-1 isis psnp-interval 50 level-2 isis hello-interval level-1 120 isis hello-interval level-2 150 ! interface r1-eth1 ip address 10.0.0.10/30 ip router isis 1 ! interface lo ip address 192.0.2.1/32 ip router isis 1 isis passive ! router isis 1 net 49.0000.0000.0000.0001.00 metric-style wide ``` Produces: ``` { "areas":[ { "area":"1", "circuits":[ { "circuit":2, "interface":{ "name":"r1-eth0", "state":"Up", "is-passive":"active", "circuit-id":"0x2", "type":"lan", "level":"L1L2", "snpa":"6e28.9c92.da5e", "levels":[ { "level":"L1", "metric":10, "active-neighbors":1, "hello-interval":120, "holddown":{ "count":10, "pad":"yes" }, "cnsp-interval":90, "psnp-interval":70, "lan":{ "priority":44, "is-dis":"no" } }, { "level":"L2", "metric":10, "active-neighbors":1, "hello-interval":120, <<<<<<<<<<<<<<<<<< "holddown":{ "count":10, "pad":"yes" }, "cnsp-interval":90, <<<<<<<<<<<<<<<<<< "psnp-interval":70, <<<<<<<<<<<<<<<<<< "lan":{ "priority":44, <<<<<<<<<<<<<<<<<< "is-dis":"no" } } ], ... ``` Fixes: 9fee4d4c6038ef6b14e9f509d6b04d189660c4cd ("isisd: Add json to show isis interface command.") Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-11-06isisd: fix crash when switching P2P after shutdowning LAN circuitbaozhen-H3C
When shutdown a LAN-type circuit, and if the current device is not the DIS (assuming it is a level-1 device), the isis_circuit_down() function will not call the isis_dr_resign() function to clear the circuit->u.bc.run_dr_elect[0] bit (this bit is set on interfaces in the isis_run_dr() function). After switching the link to a P2P type, since u.p2p and u.bc form a union, and circuit->u.bc.snpa = "\000\000\000\000\000" and circuit->u.bc.run_dr_elect = "\001", this results in circuit->u.p2p.neighbor = 0x1000000000000. Consequently, the value of adj->sysid accesses a wild pointer, causing the current crash. The backtrace is as follows: (gdb) bt #0 0x00007fbd30e55fe1 in raise () from /lib/x86_64-linux-gnu/libpthread.so.0 #1 0x00007fbd30f76b29 in core_handler (signo=11, siginfo=0x7ffc60b7a270, context=0x7ffc60b7a140) at ../lib/sigevent.c:261 #2 <signal handler called> #3 0x00007fbd30dddba4 in ?? () from /lib/x86_64-linux-gnu/libc.so.6 #4 0x0000562aec46617f in isis_spf_run_lfa (area=0x562aee3a56d0, spftree=0x562aee3a51a0) at ../isisd/isis_lfa.c:2403 #5 0x0000562aec483854 in isis_run_spf_with_protection (area=0x562aee3a56d0, spftree=0x562aee3a51a0) at ../isisd/isis_spf.c:1891 #6 0x0000562aec483b05 in isis_run_spf_cb (thread=0x7ffc60b7b000) at ../isisd/isis_spf.c:1953 #7 0x00007fbd30f900bb in thread_call (thread=0x7ffc60b7b000) at ../lib/thread.c:1990 #8 0x00007fbd30f2897b in frr_run (master=0x562aee0833c0) at ../lib/libfrr.c:1198 #9 0x0000562aec454d6d in main (argc=5, argv=0x7ffc60b7b228, envp=0x7ffc60b7b258) at ../isisd/isis_main.c:273 (gdb) f 4 #4 0x0000562aec46617f in isis_spf_run_lfa (area=0x562aee3a56d0, spftree=0x562aee3a51a0) at ../isisd/isis_lfa.c:2403 2403 ../isisd/isis_lfa.c: No such file or directory. (gdb) p circuit->u.p2p.neighbor $1 = (struct isis_adjacency *) 0x1000000000000 (gdb) p adj->sysid Cannot access memory at address 0x1000000000006 (gdb) p circuit->u.bc $2 = {snpa = "\000\000\000\000\000", run_dr_elect = "\001", t_run_dr = {0x0, 0x0}, t_send_lan_hello = {0x0, 0x0}, adjdb = {0x0, 0x0}, lan_neighs = {0x0, 0x0}, is_dr = "\000", l1_desig_is = "\000\000\000\000\000\000", l2_desig_is = "\000\000\000\000\000\000", t_refresh_pseudo_lsp = {0x0, 0x0}} (gdb) The backtrace provided above pertains to version 8.5.4, but it seems that the same issue exists in the code of the master branch as well. Signed-off-by: baozhen-H3C <bao.zhen@h3c.com>
2024-08-08isisd: Cleanup leaked hash on shut in circuitDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-11-22*: convert `struct interface->connected` to DLISTDavid Lamparter
Replace `struct list *` with `DLIST(if_connected, ...)`. NB: while converting this, I found multiple places using connected prefixes assuming they were IPv4 without checking: - vrrpd/vrrp.c: vrrp_socket() - zebra/irdp_interface.c: irdp_get_prefix(), irdp_if_start(), irdp_advert_off() (these fixes are really hard to split off into separate commits as that would require going back and reapplying the change but with the old list handling) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-11-02lib: convert if_zapi_callbacks into actual hooksDavid Lamparter
...so that multiple functions can be subscribed. The create/destroy hooks are renamed to real/unreal because that's what they *actually* signal. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-09-11isisd: Make SRv6 interface configurableCarmine Scarpitta
Add CLI command and functions to configure the interface used for installing SRv6 SIDs into Linux data plane 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-04-04isisd: consider link local ipv4 addresses as validPhilippe Guibert
It is not possible to create an adjacency by using interface addresses within the `169.254.0.0/24` pool. When forging the IIH messages, the interface addresses from that pool are not appended: > Neither IPv4 nor IPv6 considered usable. Ignoring IIH Using this network pool is possible on other IS-IS implementations. Let us authorize to use such network addresses. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
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_cancelXXX to event_cancelXXXDonald Sharp
Modify the code base so that thread_cancel becomes event_cancel 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 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-03-20Merge pull request #12688 from dorDiogo/isis_hello_padding_sometimesRuss White
isisd: Add support for IS-IS hello padding during-adjacency-formation
2023-02-28isisd: Add advertise high metrics base functionalityIsabella de Leon
Implement advertise-high-metrics set function - when advertise-high-metrics is configured, iterate through each isis interface and update each metric to its high metric value. When advertise-high-metrics is disabled, revert each interface's metric to its originally configured value. Signed-off-by: Isabella de Leon <ideleon@microsoft.com>
2023-02-28isisd,tests,doc: Rename hello padding sometimes to hello padding ↵Diogo Oliveira
during-adjacency-formation Signed-off-by: Diogo Oliveira <14191454+dorDiogo@users.noreply.github.com>
2023-02-28isisd: Add support for isis hello padding sometimesDiogo Oliveira
New configuration to pad ISIS hello packets during adjacency formation only. Signed-off-by: Diogo Oliveira <14191454+dorDiogo@users.noreply.github.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-10-24isisd: avoid fast-reroute from running twice on a down interface eventLouis Scalbert
isis_ifp_down() may in some circumstances be called twice on a down interface event. Avoid applying fast-reroute on an already down interface. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.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 when an interface falls downLouis Scalbert
Backup routes are sent to zebra by routing daemons such as isisd so that the dataplane can pre-install them with a lower priority. When an interface comes down, the associated primary routes are discarded by the dataplane and the backup ones take over. However, some dataplanes (e.g. Netlink ones) do not pre-install the backup routes. Associated prefixes have no next-hop until SPF is recomputed. Apply fast-reroute as soon as an interface falls down by sending route UPDATEs to zebra. 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-09-02isisd: Correct Valgrind errorsOlivier Dugeon
Runing most of isisd tests with --valgrind-memleaks give many memory errors. This is due to the way isisd is stopped: performing a "no router isis XXX" through CLI solves most of them. Indeed, isis_finish() doesn't call isis_area_destroy() leaving many allocated memory unfreed. This patch adds call to appropriate delete function or XFREE() when necessary to properly free all alocated memory before terminating isisd. Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.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-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: apply fast-reroute when an interface falls down"Donatas Abraitis
This reverts commit 62e458278b3d261f492ffeac7ed70b32272a43dd.
2022-07-10Revert "isisd: avoid fast-reroute on down adjacency when the interface is down"Donatas Abraitis
This reverts commit 08e4960ab48c1c9e4227e40b286d5cbc4ac581f0.
2022-07-10Revert "isisd: avoid fast-reroute from running twice on a down interface event"Donatas Abraitis
This reverts commit d526476184999275c318b13f92ae6b38a0250052.
2022-07-08Merge pull request #10962 from louis-6wind/lfa-netlinkRuss White
isisd: apply fast-reroute as soon an interface or an adjacency falls down
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-05-24isisd: avoid fast-reroute from running twice on a down interface eventLouis Scalbert
isis_ifp_down() may in some circumstances be called twice on a down interface event. Avoid applying fast-reroute on an already down interface. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
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 when an interface falls downLouis Scalbert
Backup routes are sent to zebra by routing daemons such as isisd so that the dataplane can pre-install them with a lower priority. When an interface comes down, the associated primary routes are discarded by the dataplane and the backup ones take over. However, some dataplanes (e.g. Netlink ones) do not pre-install the backup routes. Associated prefixes have no next-hop until SPF is recomputed. Apply fast-reroute as soon as an interface falls down by sending route UPDATEs to zebra. 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-18isisd: Fix crash in ISIS when mtu mismatch occurslynnemorrison
When lsp-mtu is configured larger than interface mtu and the interface is brought up, the ISIS code would crash. When other vendors have this misconfiguration they just continue ISIS running and allow the LSP packets to be created but not sent. When the misconfiguration is corrected the LSP packets start being sent. This change creates that same behavior in FRR. The startup issue I am hitting is when the isis lsp-mtu is larger that the interfaces mtu. We run into this case when we are in the process of changing the mtu on a tunnel. I issue a shutdown/no shutdown on the interface, because the tunnel MTU is smaller than the lsp-mtu, it is considered an error and calls circuit_if_del. This deletes part of the circuit information, which includes the circuit->ip_addr list. Later on we get an address update from zebra and try to add the interface address to this list and crash. 2022/04/07 20:19:52.032 ISIS: [GTRPJ-X68CG] CSM_EVENT for tun_gw2: IF_UP_FROM_Z calls isis_circuit_if_add this initialize the circuit->ip_addrs isis_circuit_up has the mtu check circuit->area->lsp_mtu > isis_circuit_pdu_size(circuit) and fails returns ISIS_ERROR on failure call isis_circuit_if_del this deletes the circiut->ip_addrs list <---- 2022/04/07 20:19:52.032 ZEBRA: [NXYHN-ZKW2V] zebra_if_addr_update_ctx: INTF_ADDR_ADD: ifindex 3, addr 192.168.0.1/24 message to isisd to add address isis_zebra_if_address_add isis_circuit_add_addr circuit->ip_addr we try to add the ip address to the list, but it was deleted above and isisd crashes Signed-off-by: Lynne Morrison <lynne.morrison@ibm.com>
2022-03-23isisd: add guard debug when compiling with EXTREME_DEBUGPhilippe Guibert
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-02-25isisd: Add json to show isis interface command.Javier Garcia
Signed-off-by: Javier Garcia <javier.martin.garcia@ibm.com>
2022-01-24*: do not print vrf name for interface config when using vrf-liteIgor Ryzhov
VRF name should not be printed in the config since 574445ec. The update was done for NB config output but I missed it for regular vty output. 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-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-11-22Merge pull request #10076 from idryzhov/if-is-loopback-or-vrfDonald Sharp
*: unify if_is_loopback/if_is_loopback_or_vrf
2021-11-16*: unify if_is_loopback/if_is_loopback_or_vrfIgor Ryzhov
We should always treat the VRF interface as a loopback. Currently, this is not the case, because in some old pre-VRF code we use if_is_loopback instead of if_is_loopback_or_vrf. To avoid any future problems, the proposal is to rename if_is_loopback_or_vrf to if_is_loopback and use it everywhere. if_is_loopback is renamed to if_is_loopback_exact in case it's ever needed, but currently it's not used anywhere. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-11-11fabricd: cleanup interface config outputIgor Ryzhov
We don't need to scan through all configured areas to find the circuit associated with the interface. It is always stored in ifp->info. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-10-30isisd: fix circuit is-type configurationIgor Ryzhov
Currently, we have a lot of checks in CLI and NB layer to prevent incompatible IS-types of circuits and areas. All these checks become completely meaningless when the interface is moved between VRFs. If the area IS-type is different in the new VRF, previously done checks mean nothing and we still end up with incorrect circuit IS type. To actually prevent incorrect IS type, all checks must be done in the processing code. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-10-25*: fix interface config write in NB-converted daemonsIgor Ryzhov
When writing the config from the NB-converted daemon, we must not rely on the operational data. This commit changes the output of the interface configuration to use only config data. As the code is the same for all daemons, move it to the lib and remove all the duplicated code. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>