summaryrefslogtreecommitdiff
path: root/isisd/isis_te.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>
2025-03-03isisd: Correct edge insertion into TEDOlivier Dugeon
Edges are not correctly linked to Vertices during LSP processing. In function lsp_to_edge_cb(), once edge created or updated from the LSP TLVs, the code try to link the edge to destination vertices. In case the revert edge is not found, the code try to found a destination vertex to link to. But, the sys_id used for this operation corresponds to the source vertex. As a result, the edge is attached as source and destination of the vertex. When Traffic Engineering is stopped, TED is deleted which result into a double free of the edge attributes. This cause a crash when attempt to free extended admin groupi the second time. This patch removed wrong code which link twice the edge to the source vertex. Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2024-09-03Merge pull request #16667 from louis-6wind/fix-isis-link-params-circuit-upRuss White
isisd: fix update link params after circuit is up
2024-08-27isisd: fix update link params after circuit is upLouis Scalbert
If the link-params are set when the circuit not yet up, the link-params are never updated. isis_link_params_update() is called from isis_circuit_up() but returns immediately because circuit->state != C_STATE_UP. circuit->state is updated in isis_csm_state_change after isis_circuit_up(). > struct isis_circuit *isis_csm_state_change(enum isis_circuit_event event, > struct isis_circuit *circuit, > void *arg) > { > [...] > if (isis_circuit_up(circuit) != ISIS_OK) { > isis_circuit_deconfigure(circuit, area); > break; > } > circuit->state = C_STATE_UP; > isis_event_circuit_state_change(circuit, circuit->area, > 1); Do not return isis_link_params_update() if circuit->state != C_STATE_UP. Fixes: 0fdd8b2b11 ("isisd: update link params after circuit is up") Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-08-27isisd: fix crash at flex-algo without mpls-teLouis Scalbert
Fix crash when flex-algo is configured and mpls-te is disabled. > interface eth0 > ip router isis 1 > ! > router isis 1 > flex-algo 129 > dataplane sr-mpls > advertise-definition > #0 __pthread_kill_implementation (no_tid=0, signo=11, threadid=140486233631168) at ./nptl/pthread_kill.c:44 > #1 __pthread_kill_internal (signo=11, threadid=140486233631168) at ./nptl/pthread_kill.c:78 > #2 __GI___pthread_kill (threadid=140486233631168, signo=signo@entry=11) at ./nptl/pthread_kill.c:89 > #3 0x00007fc5802e9476 in __GI_raise (sig=11) at ../sysdeps/posix/raise.c:26 > #4 0x00007fc58076021f in core_handler (signo=11, siginfo=0x7ffd38d42470, context=0x7ffd38d42340) at lib/sigevent.c:248 > #5 <signal handler called> > #6 0x000055c527f798c9 in isis_link_params_update_asla (circuit=0x55c52aaed3c0, ifp=0x55c52a1044e0) at isisd/isis_te.c:176 > #7 0x000055c527fb29da in isis_instance_flex_algo_create (args=0x7ffd38d43120) at isisd/isis_nb_config.c:2875 > #8 0x00007fc58072655b in nb_callback_create (context=0x55c52ab1d2f0, nb_node=0x55c529f72950, event=NB_EV_APPLY, dnode=0x55c52ab06230, resource=0x55c52ab189f8, errmsg=0x7ffd38d43750 "", > errmsg_len=8192) at lib/northbound.c:1262 > #9 0x00007fc580727625 in nb_callback_configuration (context=0x55c52ab1d2f0, event=NB_EV_APPLY, change=0x55c52ab189c0, errmsg=0x7ffd38d43750 "", errmsg_len=8192) at lib/northbound.c:1662 > #10 0x00007fc580727c39 in nb_transaction_process (event=NB_EV_APPLY, transaction=0x55c52ab1d2f0, errmsg=0x7ffd38d43750 "", errmsg_len=8192) at lib/northbound.c:1794 > #11 0x00007fc580725f77 in nb_candidate_commit_apply (transaction=0x55c52ab1d2f0, save_transaction=true, transaction_id=0x0, errmsg=0x7ffd38d43750 "", errmsg_len=8192) > at lib/northbound.c:1131 > #12 0x00007fc5807260d1 in nb_candidate_commit (context=..., candidate=0x55c529f0a730, save_transaction=true, comment=0x0, transaction_id=0x0, errmsg=0x7ffd38d43750 "", errmsg_len=8192) > at lib/northbound.c:1164 > #13 0x00007fc58072d220 in nb_cli_classic_commit (vty=0x55c52a0fc6b0) at lib/northbound_cli.c:51 > #14 0x00007fc58072d839 in nb_cli_apply_changes_internal (vty=0x55c52a0fc6b0, > xpath_base=0x7ffd38d477f0 "/frr-isisd:isis/instance[area-tag='1'][vrf='default']/flex-algos/flex-algo[flex-algo='129']", clear_pending=false) at lib/northbound_cli.c:178 > #15 0x00007fc58072dbcf in nb_cli_apply_changes (vty=0x55c52a0fc6b0, xpath_base_fmt=0x55c528014de0 "./flex-algos/flex-algo[flex-algo='%ld']") at lib/northbound_cli.c:234 > #16 0x000055c527fd3403 in flex_algo_magic (self=0x55c52804f1a0 <flex_algo_cmd>, vty=0x55c52a0fc6b0, argc=2, argv=0x55c52ab00ec0, algorithm=129, algorithm_str=0x55c52ab120d0 "129") > at isisd/isis_cli.c:3752 > #17 0x000055c527fc97cb in flex_algo (self=0x55c52804f1a0 <flex_algo_cmd>, vty=0x55c52a0fc6b0, argc=2, argv=0x55c52ab00ec0) at ./isisd/isis_cli_clippy.c:6445 > #18 0x00007fc5806b9abc in cmd_execute_command_real (vline=0x55c52aaf78f0, vty=0x55c52a0fc6b0, cmd=0x0, up_level=0) at lib/command.c:984 > #19 0x00007fc5806b9c35 in cmd_execute_command (vline=0x55c52aaf78f0, vty=0x55c52a0fc6b0, cmd=0x0, vtysh=0) at lib/command.c:1043 > #20 0x00007fc5806ba1e5 in cmd_execute (vty=0x55c52a0fc6b0, cmd=0x55c52aae6bd0 "flex-algo 129\n", matched=0x0, vtysh=0) at lib/command.c:1209 > #21 0x00007fc580782ae1 in vty_command (vty=0x55c52a0fc6b0, buf=0x55c52aae6bd0 "flex-algo 129\n") at lib/vty.c:615 > #22 0x00007fc580784a05 in vty_execute (vty=0x55c52a0fc6b0) at lib/vty.c:1378 > #23 0x00007fc580787131 in vtysh_read (thread=0x7ffd38d4ab10) at lib/vty.c:2373 > #24 0x00007fc58077b605 in event_call (thread=0x7ffd38d4ab10) at lib/event.c:2011 > #25 0x00007fc5806f8976 in frr_run (master=0x55c529df9b30) at lib/libfrr.c:1212 > #26 0x000055c527f301bc in main (argc=5, argv=0x7ffd38d4ad58, envp=0x7ffd38d4ad88) at isisd/isis_main.c:350 > (gdb) f 6 > #6 0x000055c527f798c9 in isis_link_params_update_asla (circuit=0x55c52aaed3c0, ifp=0x55c52a1044e0) at isisd/isis_te.c:176 > 176 list_delete_all_node(ext->aslas); > (gdb) p ext > $1 = (struct isis_ext_subtlvs *) 0x0 Fixes: ae27101e6f ("isisd: fix building asla at first flex-algo config") Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-07-26Merge pull request #15797 from pguibert6WIND/isis_srv6_ls_subnetRuss White
isis, lib: add isis srv6 end sid to ls_prefix
2024-07-26isisd: fix building asla at first flex-algo configLouis Scalbert
When an color affinity is set on an interface before configuring the flex-algorithm, the ASLA (Application Specific Link-Attribute) sub-TLV is not build. Flex-algo fails to build the paths when a affinity constraint is required because of the lacking of information contained in ASLA. There are no problems when the configuration order is reversed. For example: > affinity-map red bit-position 1 > > interface eth2 > link-params > affinity red > > router isis 1 > mpls-te on > flex-algo 129 > dataplane sr-mpls > advertise-definition > affinity include-any green In isis_link_params_update_asla(), the ASLA sub-TLV is not build when the list of flex-algos is empty. Update ASLA when the first flex-algorithm is configured. Fixes: 893882ee20 ("isisd: add isis flex-algo configuration backend") Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-07-11isis, lib: add isis srv6 end sid to ls_prefixPhilippe Guibert
According to draft-ietf-lsr-isis-srv6-extensions draft, the End SID should be available in link state prefix information. Add the SID information in the link state prefix, by getting the END SID from the locator TLV information. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-05-05isisd: remove unnecessary check for vrfanlan_cs
The `vrf_name` is always non-NULL in `isisd` code, so remove the unnecesary check to make it clear. Signed-off-by: anlan_cs <anlan_cs@tom.com>
2024-04-23isis, lib: add isis srv6 capability to ls_nodePhilippe Guibert
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-23isisd, lib: add link state support for srv6 adjacenciesPhilippe Guibert
Add support for endx_lan and endx adjacency. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-04-20Merge pull request #12933 from Orange-OpenSource/link_statePhilippe Guibert
lib: Update edge key in link state database
2023-04-18isisd: add ASLA supportLouis Scalbert
Add the support of ASLA with the following TLV: - Extended IS Reachability (already defined TLV 22) - Application-Specific Link Attributes (Sub-TLV 16) (to enable the Flex-Algo flag on a link) - Admin-group (Sub-Sub-TLV 3) - Extended Admin-group (Sub-Sub-TLV 14) Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-18lib,isisd: refactor igp-agnostic sr misc functionsHiroki Shirokura
SR Algorithms are independent of specific IGPs such as IS-IS. This commit adds lib/sr to aggregate IGP agnostic functions and constants. Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com> Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com> Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-11Merge pull request #12698 from Orange-OpenSource/isisdRuss White
Isisd/Lib: Add new printfrr format facility for Intermediate System ID
2023-04-07isisd: Update TE to new Link State Edge keyOlivier Dugeon
Following the modification of the edge key in link state database this patch updates the isis_te.c file to replace the old uint64_t edge key by the new ls_edge_key structure. Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2023-04-06*: Use a `struct prefix *p` instead of a `struct prefix` in functionsDonald Sharp
When passing a prefix into a function let's pass by address instead of pass by value. Let's save our stack space. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-30isisd: Correction of subnets creation in the TEDOlivier Dugeon
Subnets may be incorrectly created in the IS-IS Traffic Engineering Database (TED). Indeed, to be usable, the subnets advertised by IS-IS peers must be adjusted to avoid misinterpretation. For example, consider R1 which is connected to R2 with IP addresses 10.0.0.1/24 (R1) and 10.0.0.2/24 (R2). R1 and R2 will advertize the prefix 10.0.0.0/24. By leaving the subnet with the prefix 10.0.0.0/24 in the TED, it is not possible to determine whether 10.0.0.1 is attached to R1 or R2 or whether 10.0.0.3 exists. So to avoid this, the subnet prefixes are adjusted with the IP addresses of the local interface. But IS-IS can start to advertise the subnet when not all adjacencies are up, especially when IPv4 and IPv6 are configured on the same interface. This results in an uncorrected prefix, e.g. 10.0.0.0/24, remaining in the TED when it should be removed. This problem affects some isis-related tests such as the CSPF test. This patch fixes this bug by removing the uncorrected prefix before adding the the corrected version. Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.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*: 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-17Merge pull request #12780 from opensourcerouting/spdx-license-idDonald Sharp
*: convert to SPDX License identifiers
2023-02-10lib,isisd: add extended admin-group info into the tedLouis Scalbert
Add extended admin-group info into the ted. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-02-10isisd: add extended admin-groupLouis Scalbert
Add to the Extended IS Reachability TLV the support of Extended Administrative-Groups (RFC7308) Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-02-09Merge pull request #12730 from louis-6wind/fix-ext-te-metricsOlivier Dugeon
Fix for Extended TE metrics
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-02-02isisd: fix te link delay displayLouis Scalbert
Apply the TE_EXT_MASK mask to display a 24 bits instead of a wrong 32 bits value that includes unrelated bits. Fixes: 1b3f47d04c ("isisd: Update TLVs processing for TE, RI & SR") Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-01-31isisd: Add missing enum's to switch statementDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-10-24isisd: fix recreating the LS TED after re-enabling MPLS TELouis Scalbert
When disabling and re-enabling the "mpls-te on" command, the LS TED database is deleted but not re-created. Cleanup the LS TED database instead of deleting it when disabling "mpls-te". Fixes: 1fa6385040.. ("isisd: Correct Valgrind errors") Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-10-24isisd: fix sending remote interface ip address after enabling MPLS TELouis Scalbert
If MPLS TE is enabled, the router encodes the local and remote interface IP address in the "Extended Reachability" TLV. > east-vm(config)# do show isis database detail east-vm.00-00 > Extended Reachability: 0007.e901.3333.00 (Metric: 10) > Local Interface IP Address(es): 10.126.0.2 > Remote Interface IP Address(es): 10.126.0.3 > Maximum Bandwidth: 1.76258e+08 (Bytes/sec) The remote interface is added when the circuit adjacency comes up after setting MPLS TE. However, if MPLS TE is enabled after, the remote address is not added. It happens after disabling and re-enabling the MPLS TE. > east-vm(config)# router isis 1 > east-vm(config-router)# no mpls on > east-vm(config-router)# mpls on > east-vm(config)# do show isis database detail east-vm.00-00 > Extended Reachability: 0007.e901.3333.00 (Metric: 10) > Local Interface IP Address(es): 10.126.0.2 > Maximum Bandwidth: 1.76258e+08 (Bytes/sec) Update the remote IPv4 and IPv6 of all adjacencies after enabling MPLS TE. Fixes: 1b3f47d04c ("isisd: Update TLVs processing for TE, RI & SR") 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-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-06isisd: Prevent direct copy of different size prefix'esDonald Sharp
Memory is allocated for a `struct prefix_ipv6` but it was directly copied into a `struct prefix` via direct pointer copy, which leads to a read past end of memory. Fix by using prefix_copy Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-05-06isisd: Fix read past end of stringDonald Sharp
using a memcpy for a strdup'ed string. bad mojo Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-01*: Fix spelling of FollowingDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-02isisd: Fixup IS-IS-TE bugOlivier Dugeon
Default metric is not correctly propagated to Link State client due to a missing flag on Link State Attributes. This patch correct the problem. Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2022-01-31bgpd,pimd,isisd,nhrpd: Convert to vty_json()Donatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-30isisd: Add Link State Traffic Engineering supportOlivier Dugeon
Add Link State TED features to isis_te.c and new CLI to export LS TED and show LS TED to IS-IS. IS-IS LSPs are parse each time a new LSP event occurs in order to update accordingly the Link State Traffic Engineering Database. LS TED could be exported through the ZAPI Opaque message (see sharpd as example). Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.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>
2020-10-22isisd: replace inet_ntoaMark Stapp
Replace use of inet_ntoa, using pI4 Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-08-26isisd: minor cleanupRenato Westphal
* Bring back some consts that were removed; * Replace ALL_LIST_ELEMENTS by ALL_LIST_ELEMENTS_RO whenever possible; * Fix some CLI return values; * Remove some unnecessary initializations. 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-07-14*: remove PRI[udx](8|16|32)David Lamparter
These are completely pointless and break coccinelle string replacements. Scripted commit, idempotent to running: ``` python3 tools/stringmangle.py --pri8-16-32 `git ls-files | egrep '\.[ch]$'` ``` Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-02*: generously apply constDavid Lamparter
const const const your boat, merrily down the stream... Signed-off-by: David Lamparter <equinox@diac24.net>
2019-09-25isisd: circuit is derefed in every code pathDonald Sharp
No need to check for circuit being null, we have already de-refed it in every code path and would have crashed before this point if it was. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-17isisd: Update TLVs processing for TE, RI & SROlivier Dugeon
In preparation to Segment Routing: - Update the management of Traffic Engineering subTLVs to the new tlvs parser - Add Router Capability TLV 242 as per RFC 4971 & 7981 - Add Segment Routing subTLVs as per draft-isis-segment-routing-extension-25 Modified files: - isis_tlvs.h: add new structure to manage TE subTLVs, TLV 242 & SR subTLVs - isis_tlvs.c: add new functions (pack, copy, free, unpack & print) to process TE subTLVs, Router Capability TLV and SR subTLVs - isis_circuit.[c,h] & isis_lsp.[c,h]: update to new subTLVs & TLV processing - isis_te.[c,h]: remove all old TE structures and managment functions, and add hook call to set local and remote IP addresses as wellas update TE parameters - isis_zebra.[c,h]: add hook call when new interface is up - isis_mt.[c,h], isis_pdu.c & isis_northbound.c: adjust to new TE subTLVs - tests/isisd/test_fuzz_isis_tlv_tests.h.gz: adapte fuuz tests to new parser Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2019-06-23Revert "Ospf missing interface handling 2"Donald Sharp
2019-06-12*: change if_lookup_by_name() api with vrfPhilippe Guibert
the vrf_id parameter is replaced by struct vrf * parameter. this impacts most of the daemons that look for an interface based on the name and the vrf identifier. Also, it fixes 2 lookup calls in zebra and sharpd, where the vrf_id was ignored until now. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-04-30Merge pull request #3045 from opensourcerouting/atomsLou Berger
READY: lists/skiplists/rb-trees new API & sequence lock & atomic lists
2019-04-27isisd: replace dict_* with DECLARE_RBTREEDavid Lamparter
Historically, isisd has been carrying around its own red-black tree to manage its LSP DB in. This replaces that with the newly-added DECLARE_RBTREE_*. This allows completely removing the dict_* code. Signed-off-by: David Lamparter <equinox@diac24.net>