Commit Graph

163 Commits

Author SHA1 Message Date
Philippe Guibert
fe5b03a10b isisd: add locator name in sid notify messages
In the near future, some daemons may only register SIDs. This may be
the case for the pathd daemon when creating SRv6 binding SIDs.

When a locator is getting deleted at ZEBRA level, the daemon may have
an easy way to find out the SIds to unregister to.

This commit proposes to add the locator name to the SID_SRV6_NOTIFY
message whenever possible. Only case when an allocation failure happens,
the locator will not be present. In all other places, the notify API
at procol levels has the locator name extra-parameter.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-06-18 18:33:54 +02:00
Carmine Scarpitta
a2b83a9dec isisd: Cleanup related to SRv6
Remove unused SRv6 code.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-06-18 18:33:29 +02:00
Carmine Scarpitta
0af0f4616d isisd: Receive SRv6 SIDs notifications from zebra
Zebra sends a SRV6_SID_NOTIFY notification to inform clients about the
result of a SID alloc/release operation.  This commit adds a handler to
process a SRV6_SID_NOTIFY notification received from zebra.

If the notification indicates that a SID allocation operation was
successful, then it stores the allocated SID in the SRv6 database,
installs the SID into the RIB, and advertises the SID to the other IS-IS
routers.

If the notification indicates that an operation has failed, it logs the
error.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-06-18 18:33:29 +02:00
Carmine Scarpitta
1224d15653 isisd: Receive SRv6 locator info from zebra
This commit extends IS-IS to process locator information received from
SRv6 Manager (zebra) and save the locator info in the SRv6 database.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-06-18 18:33:29 +02:00
Carmine Scarpitta
9ae38eede8 isisd: Deal with SRv6 locator instead of chunk
Currently, when SRv6 is enabled in IS-IS, IS-IS requests a locator chunk
from Zebra. Zebra assigns a locator chunk to IS-IS, and then IS-IS can
allocate SIDs from the locator chunk.

Recently, the implementation of SRv6 in Zebra has been improved, and a
new API has been introduced for obtaining/releasing the SIDs.

Now, the daemons no longer need to request a chunk.

Instead, the daemons interact with Zebra to obtain information about the
locator and subsequently to allocate/release the SIDs.

This commit extends IS-IS to use the new SRv6 API. In particular, it
removes the chunk throughout the IS-IS code and modifies IS-IS to
request/save/advertise the locator instead of the chunk.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-06-18 18:33:29 +02:00
Carmine Scarpitta
3fce2928e2 isisd: Add API to get/release SRv6 SIDs
Add an API to get/release SRv6 SIDs through the SRv6 SID Manager.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-06-18 18:33:29 +02:00
Carmine Scarpitta
73bfc5865f isisd: Add API to get SRv6 locator info
Add an API to request information from the SRv6 SID Manager (zebra)
regarding a specific SRv6 locator.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-06-18 18:33:29 +02:00
Philippe Guibert
2e1be61b08 isisd: fix mispelling with ISIS_SR_LAN_BACKUP
The ISIS_SR_LAN_BACKUP should be renamed to ISIS_SR_ADJ_BACKUP.

Fixes: 26f6acafc3 ("isisd: add support for segment routing")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-04 15:10:47 +02:00
David Lamparter
cc90c54b36 *: add zclient_options_sync
... and use it instead of fiddling with the `.synchronous` field.

(Make it const while at it.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-11-23 15:20:13 +01:00
Carmine Scarpitta
46d1028a89 isisd: Fix SRv6 memory leaks
When isis_zebra_process_srv6_locator_chunk() returns prematurely
due to an error, do not forget to free memory allocated by
srv6_locator_chunk_alloc().

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2023-09-21 18:43:04 +02:00
Philippe Guibert
f4ac971fcc isisd: fix crash when configuring srv6 locator without isis instance
After the ISIS daemon is launched, the configuration of an srv6
locator in zebra triggers a crash:

> #4  0x00007f1f0ea980f3 in core_handler (signo=11, siginfo=0x7ffdb750de70, context=0x7ffdb750dd40)
>     at /build/make-pkg/output/_packages/cp-routing/src/lib/sigevent.c:262
> #5  <signal handler called>
> #6  0x00005651a05783ef in isis_zebra_process_srv6_locator_add (cmd=117, zclient=0x5651a21d9bd0, length=25, vrf_id=0)
>     at /build/make-pkg/output/_packages/cp-routing/src/isisd/isis_zebra.c:1258
> #7  0x00007f1f0ead5ac9 in zclient_read (thread=0x7ffdb750e750) at /build/make-pkg/output/_packages/cp-routing/src/lib/zclient.c:4246
> #8  0x00007f1f0eab19d4 in thread_call (thread=0x7ffdb750e750) at /build/make-pkg/output/_packages/cp-routing/src/lib/thread.c:1825
> #9  0x00007f1f0ea4862e in frr_run (master=0x5651a1f65a40) at /build/make-pkg/output/_packages/cp-routing/src/lib/libfrr.c:1155
> #10 0x00005651a051131a in main (argc=5, argv=0x7ffdb750e998, envp=0x7ffdb750e9c8)
>     at /build/make-pkg/output/_packages/cp-routing/src/isisd/isis_main.c:282
> (gdb) f 6
> #6  0x00005651a05783ef in isis_zebra_process_srv6_locator_add (cmd=117, zclient=0x5651a21d9bd0, length=25, vrf_id=0)
>     at /build/make-pkg/output/_packages/cp-routing/src/isisd/isis_zebra.c:1258
> (gdb) print isis
> $1 = (struct isis *) 0x0
> (gdb) print isis->area_list
> Cannot access memory at address 0x28

The isis pointer is NULL, because no instances have already been
configured on the ISIS instance.
Fix this by checking that there is any isis instance available when
zebra hooks related to srv6 are received.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-09-20 15:07:35 +02:00
Carmine Scarpitta
6ae2a525cf isisd: Fix CID 1568134 (Null pointer dereference)
Null check `isis` pointer before dereferencing it.

Fixes this coverity issue:

*** CID 1568134:  Null pointer dereferences  (NULL_RETURNS)
/isisd/isis_zebra.c: 1146 in isis_zebra_process_srv6_locator_chunk()
1140                    "prefix %pFX, block_len %u, node_len %u, func_len %u, arg_len %u",
1141                    chunk->locator_name, &chunk->prefix, chunk->block_bits_length,
1142                    chunk->node_bits_length, chunk->function_bits_length,
1143                    chunk->argument_bits_length);
1144
1145            /* Walk through all areas of the ISIS instance */
>>>     CID 1568134:  Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing "isis", which is known to be "NULL".
1146            for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area)) {
1147                    if (strncmp(area->srv6db.config.srv6_locator_name,
1148                                chunk->locator_name,
1149                                sizeof(area->srv6db.config.srv6_locator_name)) != 0)
1150                            continue;
1151

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2023-09-15 17:42:04 +02:00
Carmine Scarpitta
9de5b3bf58 isisd: Fix CID 1568133 (Null pointer dereference)
Null checking the `sra` pointer after dereferencing it causes a
coverity issue. Let's perform the null check before dereferencing the
pointer.

Fixes this coverity issue:

*** CID 1568133:  Null pointer dereferences  (REVERSE_INULL)
/isisd/isis_zebra.c: 1077 in isis_zebra_srv6_adj_sid_uninstall()
1071            enum seg6local_action_t action = ZEBRA_SEG6_LOCAL_ACTION_UNSPEC;
1072            struct interface *ifp;
1073            uint16_t prefixlen = IPV6_MAX_BITLEN;
1074            struct isis_circuit *circuit = sra->adj->circuit;
1075            struct isis_area *area = circuit->area;
1076
>>>     CID 1568133:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "sra" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
1077            if (!sra)
1078                    return;
1079
1080            switch (sra->behavior) {
1081            case SRV6_ENDPOINT_BEHAVIOR_END_X:
1082                    prefixlen = IPV6_MAX_BITLEN;

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2023-09-15 17:42:04 +02:00
Carmine Scarpitta
f3b4e6664f isisd: Fix CID 1568132 (Null pointer dereference)
Null checking the `sra` pointer after dereferencing it causes a
coverity issue. Let's perform the null check before dereferencing the
pointer.

Fixes this coverity issue:

*** CID 1568132:  Null pointer dereferences  (REVERSE_INULL)
/isisd/isis_zebra.c: 1023 in isis_zebra_srv6_adj_sid_install()
1017            struct seg6local_context ctx = {};
1018            uint16_t prefixlen = IPV6_MAX_BITLEN;
1019            struct interface *ifp;
1020            struct isis_circuit *circuit = sra->adj->circuit;
1021            struct isis_area *area = circuit->area;
1022
>>>     CID 1568132:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "sra" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
1023            if (!sra)
1024                    return;
1025
1026            sr_debug("ISIS-SRv6 (%s): setting adjacency SID %pI6", area->area_tag,
1027                     &sra->sid);
1028

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2023-09-15 17:42:04 +02:00
Carmine Scarpitta
bfec26bc7a isisd: Make SRv6 interface configurable
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-09-11 22:11:51 +02:00
Carmine Scarpitta
a1be1942f5 isisd: Remove SIDs when parent locator is deleted
Clean up SRv6 SIDs when the parent locator is deleted.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 22:11:49 +02:00
Carmine Scarpitta
ecb2675f1e isisd: Add support for SRv6 Adjacency SIDs
An SRv6 adjacency SID is a SID that is associated with a particular
adjacency. Adjacency SIDs are advertised using the SRv6 End.X SID
Sub-TLV (RFC 9352 section #8.1) or SRv6 LAN End.X SID Sub-TLV (RFC 9352
section #8.2).

This commit defines the following Adj SIDs management functions:
* srv6_endx_sid_add_single: add a new SRv6 Adjacency SID
* srv6_endx_sid_del: delete an SRv6 Adjacency SID
* isis_srv6_endx_sid_find: lookup SRv6 End.X SID by type

It also attaches some callbacks to the hooks isis_adj_state_change_hook,
isis_adj_ip_enabled_hook, isis_adj_ip_disabled_hook, which are
responsible for installing/removing an SRv6 Adjacency SID automatically
when the state of an IS-IS adjacency changes.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 22:11:47 +02:00
Carmine Scarpitta
7db1a90475 isisd: Add functions to install/remove adj SIDs
Add two functions to install/remove Adjacency SIDs into the data plane
through zebra.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 22:11:47 +02:00
Carmine Scarpitta
58d85ce965 isisd: Install SRv6 End SID automatically
When zebra assigns a chunk to IS-IS, zebra sends a
ZEBRA_SRV6_MANAGER_GET_LOCATOR_CHUNK notification to IS-IS.
IS-IS invokes the `isis_zebra_process_srv6_locator_chunk()` callback to
process the received notification.

Actually, `isis_zebra_process_srv6_locator_chunk()` iterates over all
areas of the current IS-IS instance and looks for an area for which the
received chunk was requested.
If a match is found, the new chunk is added to the area's chunk list and
`lsp_regenerate_schedule()` is called to regenerate the LSPs to
advertise the new SRv6 locator.

This commit extends the `isis_zebra_process_srv6_locator_chunk()`
function to automatically allocate an SRv6 End SID from the received
chunk and install it in the data plane.

The SRv6 End SID is the instantiation of a Prefix-SID (RFC 8986 section

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 17:35:06 +02:00
Carmine Scarpitta
ea7f533352 isisd: Add func to remove SRv6 SID from dplane
Add a function to remove an SRv6 SID from the data plane through
zebra.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 17:35:06 +02:00
Carmine Scarpitta
8b6d051c54 isisd: Add func to install SRv6 SID in dplane
Add a function to install an SRv6 SID in the data plane through
zebra.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 17:35:05 +02:00
Carmine Scarpitta
a239951dde isisd: Add function to send SRv6 SID to zebra
Add a function to install/remove an SRv6 SID in the forwarding plane
through Zebra.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 17:35:05 +02:00
Carmine Scarpitta
7064d8a727 isisd: Uninstall routes only if installed
In some cases, IS-IS may attempt to remove routes that have not been
installed before. We can prevent IS-IS from doing this by aborting
`isis_zebra_route_del_route` when the ISIS_ROUTE_FLAG_ZEBRA_SYNCED flag
is unset, meaning that the route is not installed in the kernel.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 17:35:04 +02:00
Carmine Scarpitta
d223a8167e isisd: Add func to process a deleted SRv6 locator
Add a callback function `isis_zebra_process_srv6_locator_delete()` that
is called when an SRv6 locator is deleted in zebra.

When an existing SRv6 locator is deleted in zebra, zebra sends a
ZEBRA_SRV6_LOCATOR_DELETE notification to all daemons informing them of
the deleted locator.

In IS-IS, we register the new `isis_zebra_process_srv6_locator_delete()`
callback as the handler for ZEBRA_SRV6_LOCATOR_DELETE.

This callback iterates over all areas of the current IS-IS instance and
looks for an area for which the deleted locator was configured.
If a match is found, we remove
the locator's chunks from the area's chunks list and call
`lsp_regenerate_schedule` to remove the locator from the SRv6 Locator
TLV advertised in the LSPs and regenerate the LSPs.
If no match is found, we do nothing.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 17:34:54 +02:00
Carmine Scarpitta
5b9c03b0d3 isisd: Add func to process a received SRv6 locator
Add a callback function `isis_zebra_process_srv6_locator_add()` that is
called upon receiving an SRv6 locator from zebra.

When a new SRv6 locator is created in zebra, zebra sends a
ZEBRA_SRV6_LOCATOR_ADD notification to all daemons informing them of the
new locator.

In IS-IS, we register the new `isis_zebra_process_srv6_locator_add()`
callback as the handler for ZEBRA_SRV6_LOCATOR_ADD.

This callback iterates over all areas of the current IS-IS instance and
looks for an area for which the new locator was configured.
If a match is found, we call
`isis_zebra_srv6_manager_get_locator_chunk()` to ask zebra a chunk from
the locator.
If no match is found, we do nothing.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 17:34:54 +02:00
Carmine Scarpitta
86d9dc4980 isisd: Add function to process received SRv6 chunk
Add a callback function that is called upon receiving an SRv6 locator
chunk from zebra.

This function iterates over all areas of the current IS-IS instance and
looks for an area for which the received chunk was requested.
If a match is found, the new chunk is added to the area's chunk list and
`lsp_regenerate_schedule()` is called to regenerate the LSPs to
advertise the new SRv6 locator.
If no match is found, we free the allocated resources and do nothing.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 17:34:53 +02:00
Carmine Scarpitta
bef41422b4 isisd: Add func to release an SRv6 locator chunk
Add a function to ask zebra to release a chunk from the SRv6 locator
specified as a parameter.

The chunk to be released must have been allocated by a previous call to
`isis_zebra_srv6_manager_get_locator_chunk()`.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 17:34:53 +02:00
Carmine Scarpitta
b822dc4bee isisd: Add func to request an SRv6 locator chunk
Add a function to ask zebra to allocate a chunk from the SRv6 locator
specified as a parameter.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 17:34:52 +02:00
Renato Westphal
e189d1ff1b isisd: update Node-SID flag dynamically
Node-SIDs refer to Prefix-SIDs associated with host prefixes of
loopback addresses. As such, whenever an interface address is added
or deleted, all configured Prefix-SIDs must be reevaluated to check
if the N-flag needs to be set or unset.

This change fixes some race conditions in the TI-LFA topotest where
specific sequence of events could cause Prefix-SIDs to not have the
N-flag set when they should, resulting in various failures.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-07-29 14:18:39 -03:00
Philippe Guibert
4aee03bfd5 isisd: add the 'redistribute table' internal support
The 'redistribute table' command does not create the internal
contexts with the appropriate table identifier.

Redistributed prefixes in IS-IS do not care about the
table identifier. Add a linked list of redistribution
contexts, and map the nb configuration to the linked list.

- A new 'table' attribute is added in the 'struct
isis_redist' context.
- The 'isis_redist_update_zebra_subscriptions()' function
is removed and is replaced by direct call to zebra API
for turning on/off redirection.
- The redistributed routes coming from zebra import the
'tableid' information.
- The fabricd redistribute running-config is reworked,
and the 'get_redist_settings()' function is removed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-07-12 14:06:00 +02:00
Mark Stapp
220dc6df98 isisd, ospfd: fix opaque zapi source parsing
Opaque zapi messages carry the sender's zclient tuple now,
daemons shouldn't try to parse those bits directly.

Signed-off-by: Mark Stapp <mjs@labn.net>
2023-06-27 16:32:54 -04:00
Hiroki Shirokura
bdaafbf834 isisd: update struct isis_sr_psid_info with nh context
Prefix-SID nexthops and backup nexthops are stored respectively in
isis_route_info->nexthops and isis_route_info->backup->nexthops.

With Flex-Algo, there are multiple Prefix-SIDs for a single prefix in
different algorithms. Each of these Prefix-SIDs performs SPF calculation
with a separate contract and sets a nexthops, so it is necessary to
store a different set nexthops for each Prefix-SID.

Add a nexthops and backup nethops list into the Prefix-SID
isis_sr_psid_info struct and use these lists instead of the  when needed

After this commit, the nexthops for each Prefix-SID is not
taken from route_info, but the nexthop set inside the
Prefix-SID is taken. This works for backup nexthops as well.

Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-18 10:11:53 +02:00
Hiroki Shirokura
7f8dddf430 isisd: update struct isis_sr_psid_info with algorithm id
The information in prefix-sid has a new property
called algorithm id.  This is used to identify
the algorithm that separates it in the same IGP
network. This is used in Flex-Algo.In all other
cases, the algorithm id is basically 0.

Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com>
Signed-off-by: Eric Kinzie <ekinzie@labn.net>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-17 11:06:08 +02:00
Donald Sharp
24a58196dd *: Convert event.h to frrevent.h
We should probably prevent any type of namespace collision
with something else.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
cd9d053741 *: Convert struct event_master to struct event_loop
Let's find a better name for it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
2453d15dbf *: Convert struct thread_master to struct event_master and it's ilk
Convert the `struct thread_master` to `struct event_master`
across the code base.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
cb37cb336a *: Rename thread.[ch] to event.[ch]
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-24 08:32:16 -04:00
David Lamparter
acddc0ed3c *: auto-convert to SPDX License IDs
Done with a combination of regex'ing and banging my head against a wall.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-09 14:09:11 +01:00
Olivier Dugeon
d9884a758c isisd: Prepare IS-IS for Link State support
In order to provide Link State Traffic Engineering features to IS-IS, this
patch adds some modifications to base IS-IS:

- Solve bug in lsp iterate function to avoid infinite loop in isis_lsp.c by
  adding condition to recurse call
- Add new trigger event to parse LSP in isis_lsp.c
- Add new TE debug flag to track Traffic Engineering events in isisd.[c,h]
- Correct small bug in isis_tlvs.c where delay and min/max delay are not
  correctly handle
- Handle Opaque LSA Traffic Engineering Zebra API in isis_zebra.[c,h]

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2021-11-30 15:22:28 +01:00
David Lamparter
a243d1db93 *: convert zclient callbacks to table
This removes a giant `switch { }` block from lib/zclient.c and
harmonizes all zclient callback function types to be the same (some had
a subset of the args, some had a void return, now they all have
ZAPI_CALLBACK_ARGS and int return.)

Apart from getting rid of the giant switch, this is a minor security
benefit since the function pointers are now in a `const` array, so they
can't be overwritten by e.g. heap overflows for code execution anymore.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-10-20 13:28:46 +02:00
Karen Schoener
0b4124c18c isisd, ospfd: update interface_link_params callback to check for change
Adding defensive code to the interface_link_params zebra callback
to check if the link params changed before taking action.

Signed-off-by: Karen Schoener <karen@voltanet.io>
2021-06-28 10:32:52 -04:00
Igor Ryzhov
8c6482db8c isisd: fix redistribution in vrf
When the redistribution is configured in non-default VRF, isisd should
redistribute routes from this VRF instead of default.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-14 17:12:35 +03:00
Igor Ryzhov
164ab8965e isisd: deregister vrf from zebra when vrf is disabled
Currently the VRF is deregistered only when it is re-enabled again.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-14 17:12:33 +03:00
Igor Ryzhov
13bf38300e isisd: rework BFD integration
Rewrite the BFD integration code to use the new library.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-07 12:03:57 +03:00
Igor Ryzhov
ec62fbaa07 isisd: fix ldp-sync configuration
YANG model and CLI commands allow user to configure LDP-sync per area.
But the actual implementation is incorrect - all commands are changing
the config for the whole VRF instead of a single area. This commit fixes
this issue by actually implementing per area configuration.

Fixes #8578.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-29 17:05:21 +03:00
Emanuele Altomare
3b1e3aab80 isisd: added support for routemap match tag in redistribution
Now it's possible to filter routes redistributed by another protocol using tag
which comes from zebra daemon.

Example of a possible configuration:

```
!
ipv6 route fd00::/48 blackhole tag 20
ipv6 route fd00::/60 blackhole tag 10
!
interface one
 ipv6 router isis COMMON
 isis circuit-type level-1
!
interface two
 ipv6 router isis COMMON
 isis circuit-type level-2-only
!
router isis COMMON
 net fd.0000.0000.0000.0001.00
 redistribute ipv6 static level-1 route-map static-l1
 redistribute ipv6 static level-2 route-map static-l2
 topology ipv6-unicast
!
route-map static-l1 permit 10
 match tag 10
!
route-map static-l2 permit 10
 match tag 20
!
```

Signed-off-by: Emanuele Altomare <emanuele@common-net.org>
2021-03-05 22:12:00 +00:00
Renato Westphal
16fe8cffa1 isisd: implement Remote LFA
Remote LFA (RFC 7490) is an extension to the base LFA mechanism
that uses dynamically determined tunnels to extend the IP-FRR
protection coverage.

RLFA is similar to TI-LFA in that it computes a post-convergence
SPT (with the protected interface pruned from the network topology)
and the P/Q spaces based on that SPT. There are a few differences
however:
* RLFAs can push at most one label, so the P/Q spaces need to
  intersect otherwise the destination can't be protected (the
  protection coverage is topology dependent).
* isisd needs to interface with ldpd to obtain the labels it needs to
  create a tunnel to the PQ node. That interaction needs to be done
  asynchronously to prevent blocking the daemon for too long. With
  TI-LFA all required labels are already available in the LSPDB.

RLFA and TI-LFA have more similarities than differences though,
and thanks to that both features share a lot of code.

Limitations:
* Only RLFA link protection is implemented. The algorithm used
  to find node-protecting RLFAs (RFC 8102) is too CPU intensive and
  doesn't always work. Most vendors implement RLFA link protection
  only.
* RFC 7490 says it should be a local matter whether the repair path
  selection policy favors LFA repairs over RLFA repairs. It might be
  desirable, for instance, to prefer RLFAs that satisfy the downstream
  condition over LFAs that don't. In this implementation, however,
  RLFAs are only computed for destinations that can't be protected
  by local LFAs.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-01-08 22:22:11 -03:00
Karen Schoener
4d1e5644b7 ldpd, isisd, ospfd: Remove periodic ldp-sync hello message
Removing the obsolete ldp-sync periodic 'hello' message.

When ldp-sync is configured, IGPs take action if the LDP process goes down.

The IGPs have been updated to use the zapi client close callback to detect
the LDP process going down.

Signed-off-by: Karen Schoener <karen@voltanet.io>
2020-12-09 14:11:38 -05:00
Karen Schoener
cb135cc943 isisd, ospfd: IGPs detect LDP down via zapi client close message
When ldp-sync is configured, IGPs take action if the LDP process goes down.

Currently, IGPs detect the LDP process is down if they do not receive a
periodic 'hello' message from LDP within 1 second.

Intermittently, this heartbeat mechanism causes false topotest failures.
When the failure occurs, LDP is busy receiving messages from zebra for a
few seconds.  During this time, LDP does not send the expected periodic
message.

With this change, IGPs detect LDP down via zapi client close message.

Signed-off-by: Karen Schoener <karen@voltanet.io>
2020-12-09 08:41:42 -05:00
Renato Westphal
50ec21859f isisd, tests: fix bug when sending TI-LFA repair paths to zebra
Commit 4c75f7c773 fixed a bug in which the TI-LFA repair paths
weren't preserving the original Prefix-SID of the routes. That
commit, however, didn't update the zebra interface code to account
for backup nexthops that don't have a repair list but do have a
SR label. As a consequence, backup nexthops that didn't have any
repair label were not preserving the original Prefix-SID of the
corresponding routes. Fix this and update the TI-LFA topotest
accordingly.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-11-23 15:22:36 -03:00