]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
19 months agozebra: remove duplicated code
Igor Ryzhov [Sun, 17 Sep 2023 19:34:51 +0000 (22:34 +0300)]
zebra: remove duplicated code

The same thing is done in zebra_if_update_link a couple of lines above.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
19 months agoMerge pull request #14417 from Jafaral/veth
Igor Ryzhov [Fri, 15 Sep 2023 22:03:21 +0000 (01:03 +0300)]
Merge pull request #14417 from Jafaral/veth

zebra: fix link update for veth interfaces

19 months agozebra: fix link update for veth interfaces
Jafar Al-Gharaibeh [Thu, 14 Sep 2023 14:24:25 +0000 (09:24 -0500)]
zebra: fix link update for veth interfaces

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
19 months agoMerge pull request #14383 from donaldsharp/bgp_coverity_cleanup_early_sept
Donatas Abraitis [Wed, 13 Sep 2023 18:52:37 +0000 (21:52 +0300)]
Merge pull request #14383 from donaldsharp/bgp_coverity_cleanup_early_sept

Bgp coverity cleanup early sept

19 months agoMerge pull request #14410 from opensourcerouting/fix/keep_su_remote_local
Donald Sharp [Wed, 13 Sep 2023 16:12:13 +0000 (12:12 -0400)]
Merge pull request #14410 from opensourcerouting/fix/keep_su_remote_local

bgpd: Keep remote/local socket unions on BGP start event

19 months agobgpd: Keep remote/local socket unions on BGP start event
Donatas Abraitis [Wed, 13 Sep 2023 10:21:47 +0000 (13:21 +0300)]
bgpd: Keep remote/local socket unions on BGP start event

Not sure why this is needed, because it's reset on bgp_connect_success(),
when the session is UP.

When the session is reset, it clears those variables, and we are not able to
see what remote address was before, etc.

hostLocal, hostRemote reports Unknown for `show bgp neighbor json`.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agoMerge pull request #14162 from opensourcerouting/feature/turn_on_nht_resolve_via_defa...
Russ White [Wed, 13 Sep 2023 09:57:49 +0000 (05:57 -0400)]
Merge pull request #14162 from opensourcerouting/feature/turn_on_nht_resolve_via_default_for_traditional_profile

zebra: Turn on `nht resolve-via-default` by default for traditional profile

19 months agoMerge pull request #14400 from louis-6wind/local-no-retain
Donatas Abraitis [Wed, 13 Sep 2023 08:23:42 +0000 (11:23 +0300)]
Merge pull request #14400 from louis-6wind/local-no-retain

bgpd: fix import from a local VRF with no bgp retain

19 months agoMerge pull request #14404 from donaldsharp/snmp_mess_ups
Donatas Abraitis [Wed, 13 Sep 2023 06:52:19 +0000 (09:52 +0300)]
Merge pull request #14404 from donaldsharp/snmp_mess_ups

tests: snmp tests sometimes fail with `Unable to bind`

19 months agoMerge pull request #14399 from opensourcerouting/fix/bgpd_handle_BGP_MAX_ATTR
Jafar Al-Gharaibeh [Tue, 12 Sep 2023 20:12:15 +0000 (15:12 -0500)]
Merge pull request #14399 from opensourcerouting/fix/bgpd_handle_BGP_MAX_ATTR

bgpd: BGP_ATTR_MAX can be 255, allow using it for path attr

19 months agotests: snmp tests sometimes fail with `Unable to bind`
Donald Sharp [Tue, 12 Sep 2023 17:05:05 +0000 (13:05 -0400)]
tests: snmp tests sometimes fail with `Unable to bind`

the snmp tests are using zebra.conf to setup the
address that they are binding to and immediately
after that they are starting snmpd.  If snmpd
starts up *before* zebra has installed the address
the bind on the address will fail.  Causing the entire
test to fail.  Modify the snmpd.conf for all our
snmp tests to bind to all addresses.  Things still
work and we no longer have an issue.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agoMerge pull request #14397 from manojvn/mgmt_sb_commands
Donald Sharp [Tue, 12 Sep 2023 16:05:20 +0000 (12:05 -0400)]
Merge pull request #14397 from manojvn/mgmt_sb_commands

mgmtd: support bundle commands for mgmt.

19 months agoMerge pull request #14237 from Keelan10/pbrd-map-leak
Russ White [Tue, 12 Sep 2023 15:28:20 +0000 (11:28 -0400)]
Merge pull request #14237 from Keelan10/pbrd-map-leak

pbrd: Free Memory in pbr_map_delete

19 months agoMerge pull request #14365 from opensourcerouting/typesafe-const-declutter
Mark Stapp [Tue, 12 Sep 2023 15:20:50 +0000 (11:20 -0400)]
Merge pull request #14365 from opensourcerouting/typesafe-const-declutter

Revert "lib: add a frr_each_const macro"

19 months agotopotests: check route import in bgp_vpnv4_noretain
Louis Scalbert [Tue, 12 Sep 2023 11:30:57 +0000 (13:30 +0200)]
topotests: check route import in bgp_vpnv4_noretain

Check route import in bgp_vpnv4_noretain

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
19 months agotopotest: fix bgp_vpnv4_noretain test descriptions
Louis Scalbert [Tue, 12 Sep 2023 11:57:50 +0000 (13:57 +0200)]
topotest: fix bgp_vpnv4_noretain test descriptions

Fix bgp_vpnv4_noretain test descriptions

Fixes: 22dfa04b78 ("topotests: more tests in bgp_vpnv4_noretain")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
19 months agobgpd: fix vpn import from local vrf with no retain
Louis Scalbert [Mon, 11 Sep 2023 16:33:23 +0000 (18:33 +0200)]
bgpd: fix vpn import from local vrf with no retain

The BGP "no retain" VPN option avoids storing VPN prefixes that are not
imported in the incoming BGP table (aka. Adj RIB in). When a VPN import
policy is changed, BGP does a soft clear so that a prefix refresh is
requested from the peers. However, the import from local VPN prefixes
is never requested.

Fix this issue by requesting a local import refresh.

Fixes: a486300b26 ("bgpd: implement retain route-target all behaviour")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
19 months agoMerge pull request #14379 from donaldsharp/peer_connection_part_two
Russ White [Tue, 12 Sep 2023 12:51:50 +0000 (08:51 -0400)]
Merge pull request #14379 from donaldsharp/peer_connection_part_two

Peer connection part two

19 months agoMerge pull request #14348 from opensourcerouting/fpm-rr
Russ White [Tue, 12 Sep 2023 12:45:14 +0000 (08:45 -0400)]
Merge pull request #14348 from opensourcerouting/fpm-rr

zebra: support route replace semantic in FPM

19 months agoMerge pull request #13724 from cscarpitta/feature/isisd-srv6-support
Russ White [Tue, 12 Sep 2023 12:33:42 +0000 (08:33 -0400)]
Merge pull request #13724 from cscarpitta/feature/isisd-srv6-support

isisd: Add support for SRv6 uSID (RFC 9352)

19 months agobgpd: BGP_ATTR_MAX can be 255, allow using it for path attr discard/withdraw cmds
Donatas Abraitis [Tue, 12 Sep 2023 11:46:11 +0000 (14:46 +0300)]
bgpd: BGP_ATTR_MAX can be 255, allow using it for path attr discard/withdraw cmds

https://www.rfc-editor.org/rfc/rfc2042.html

says: 255 reserved for development

In FRR, 255 is kinda used too BGP_ATTR_VNC, even more we allow setting 255 in CLI.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agomgmtd: support bundle commands for mgmt daemon.
Manoj Naragund [Tue, 12 Sep 2023 08:53:04 +0000 (01:53 -0700)]
mgmtd: support bundle commands for mgmt daemon.

Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
19 months agodoc: Add documentation for IS-IS SRv6 features
Carmine Scarpitta [Sat, 3 Jun 2023 11:53:33 +0000 (13:53 +0200)]
doc: Add documentation for IS-IS SRv6 features

Add documentation for IS-IS SRv6 functionalities (RFC 9352)

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agotests: Add `isis_srv6_topo1` test for IS-IS SRv6
Carmine Scarpitta [Tue, 13 Dec 2022 15:15:21 +0000 (16:15 +0100)]
tests: Add `isis_srv6_topo1` test for IS-IS SRv6

Add a new topotest `isis_srv6_topo1` for verifying SRv6 functionalities
in IS-IS (RFC 9352).

This topotest consists of nine tests:

* Network convergence after applying SRv6 configuration
* Disable SRv6 Locator on zebra on r1
* Enable SRv6 Locator on zebra on r1
* Disable SRv6 Locator on ISIS on r1
* Enable SRv6 Locator on ISIS on r1
* Disable SRv6 on ISIS on r1
* Enable SRv6 on ISIS on r1
* Disable SRv6 on zebra on r1
* Enable SRv6 on zebra on r1

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agotests: Update fuzz test to match expected output
Carmine Scarpitta [Mon, 12 Jun 2023 16:58:34 +0000 (18:58 +0200)]
tests: Update fuzz test to match expected output

Update IS-IS fuzz test to match corrected output after the introduction
of SRv6-related TLVs.

The update was performed using wuschl [1] like this:

$ wuschl rebuild tests/isisd/test_fuzz_isis_tlv
$ gzip -9 tests/isisd/test_fuzz_isis_tlv_tests.h

[1] https://pypi.org/project/wuschl/

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Make SRv6 interface configurable
Carmine Scarpitta [Sun, 3 Sep 2023 06:54:57 +0000 (08:54 +0200)]
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>
19 months agoyang: Add SRv6 interface to IS-IS YANG model
Carmine Scarpitta [Sun, 3 Sep 2023 17:21:50 +0000 (19:21 +0200)]
yang: Add SRv6 interface to IS-IS YANG model

Add SRv6 interface to the IS-IS YANG model

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Make SRv6 Node MSDs customizable
Carmine Scarpitta [Fri, 4 Aug 2023 06:11:46 +0000 (08:11 +0200)]
isisd: Make SRv6 Node MSDs customizable

Add CLI commands to customize SRv6 Node MSD values.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoyang: Add SRv6 MSDs to IS-IS YANG model
Carmine Scarpitta [Fri, 4 Aug 2023 06:13:58 +0000 (08:13 +0200)]
yang: Add SRv6 MSDs to IS-IS YANG model

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agovtysh: Add CLI nodes for SRv6
Carmine Scarpitta [Fri, 4 Aug 2023 06:13:14 +0000 (08:13 +0200)]
vtysh: Add CLI nodes for SRv6

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agolib: Add CLI node for SRv6 Node MSD
Carmine Scarpitta [Fri, 4 Aug 2023 06:12:54 +0000 (08:12 +0200)]
lib: Add CLI node for SRv6 Node MSD

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Remove SIDs when parent locator is deleted
Carmine Scarpitta [Tue, 30 May 2023 16:55:44 +0000 (18:55 +0200)]
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>
19 months agoisisd: Initialize/free SRv6 adjacency SIDs list
Carmine Scarpitta [Sat, 3 Jun 2023 00:21:30 +0000 (02:21 +0200)]
isisd: Initialize/free SRv6 adjacency SIDs list

Initialize/free SRv6 adjacency SIDs list when an IS-IS area is
created/destroyed.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Extend `sid_exist` to consider adj SIDs
Carmine Scarpitta [Sat, 3 Jun 2023 11:39:15 +0000 (13:39 +0200)]
isisd: Extend `sid_exist` to consider adj SIDs

The function `sid_exist` verifies if a given SRv6 SID has already been
allocated for a given IS-IS area. This commit extends `sid_exist` to
also consider adjacency SIDs when checking for the existence of the SID.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Extend IS-IS adjacency with SRv6 adj SIDs
Carmine Scarpitta [Sat, 3 Jun 2023 00:14:42 +0000 (02:14 +0200)]
isisd: Extend IS-IS adjacency with SRv6 adj SIDs

Initialize/remove SRv6 SIDs list when an IS-IS adjacency is
created/deleted.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add support for SRv6 Adjacency SIDs
Carmine Scarpitta [Sat, 3 Jun 2023 00:08:08 +0000 (02:08 +0200)]
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>
19 months agoisisd: Add functions to install/remove adj SIDs
Carmine Scarpitta [Sat, 3 Jun 2023 06:41:50 +0000 (08:41 +0200)]
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>
19 months agoisisd: Add data structure for SRv6 Adjacency SIDs
Carmine Scarpitta [Sat, 3 Jun 2023 20:06:04 +0000 (22:06 +0200)]
isisd: Add data structure 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 a data structure `srv6_adjacency` for storing
information about an SRv6 Adjacency SID. This data structure will be
used to support SRv6 Adjacency SIDs functionalities in future commits.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Make MTYPE_ISIS_SUBSUBTLV non-static
Carmine Scarpitta [Sat, 3 Jun 2023 00:22:02 +0000 (02:22 +0200)]
isisd: Make MTYPE_ISIS_SUBSUBTLV non-static

We need to allocate memory SRv6 SID Structure Sub-Sub-TLV in
isis_srv6.c. MTYPE_ISIS_SUBSUBTLV is statically defined in isis_tlvs.c
and therefore is not visible in isis_srv6.c. Let's make
MTYPE_ISIS_SUBSUBTLV non-static to provide visibility to the external
world..

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Unpack SRv6 (LAN) End.X SID Sub-TLV
Carmine Scarpitta [Thu, 25 May 2023 13:21:50 +0000 (15:21 +0200)]
isisd: Unpack SRv6 (LAN) End.X SID Sub-TLV

Extend the Extended IS Reachability TLV unpack function to unpack the
SRv6 End.X SID Sub-TLV and SRv6 LAN End.X SID Sub-TLV, if present.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Pack SRv6 (LAN) End.X SID Sub-TLV
Carmine Scarpitta [Sat, 3 Jun 2023 00:39:07 +0000 (02:39 +0200)]
isisd: Pack SRv6 (LAN) End.X SID Sub-TLV

Extend the Extended IS Reachability TLV pack function to pack the SRv6
End.X SID Sub-TLV and SRv6 LAN End.X SID Sub-TLV, if present.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add SRv6 (LAN) End.X SID Sub-TLV codepoints
Carmine Scarpitta [Thu, 25 May 2023 12:50:00 +0000 (14:50 +0200)]
isisd: Add SRv6 (LAN) End.X SID Sub-TLV codepoints

Add SRv6 End.X SID Sub-TLV and SRv6 LAN End.X SID Sub-TLV codepoints
(defined in "IS-IS Sub-TLVs for TLVs Advertising Neighbor Information"
IANA registry). These codepoints will be used in future commits to
pack/unpack corresponding Sub-TLVs.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add SRv6 End.X SID to Sub-TLV format func
Carmine Scarpitta [Sat, 3 Jun 2023 00:31:05 +0000 (02:31 +0200)]
isisd: Add SRv6 End.X SID to Sub-TLV format func

Extend the Extended IS Reachability TLV format function to show the SRv6
End.X SID Sub-TLV and SRv6 LAN End.X SID Sub-TLV, if present.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add flags for SRv6 (LAN) End.X SID Sub-TLV
Carmine Scarpitta [Thu, 25 May 2023 11:03:15 +0000 (13:03 +0200)]
isisd: Add flags for SRv6 (LAN) End.X SID Sub-TLV

SRv6 End.X SID Sub-TLV (RFC 9352 section #8.1) and SRv6 LAN End.X SID
Sub-TLV (RFC 9352 section #8.2) contain a `flag` field. Currently, three
flags are defined:
* B-Flag: Backup flag
* S-Flag: Set flag
* P-Flag: Persistent flag

This commit defines three constants representing these flags.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add SRv6 End.X SID to Sub-TLV copy func
Carmine Scarpitta [Sat, 3 Jun 2023 00:37:07 +0000 (02:37 +0200)]
isisd: Add SRv6 End.X SID to Sub-TLV copy func

Extend the Extended IS Reachability TLV copy function to copy the SRv6
End.X SID Sub-TLV and SRv6 LAN End.X SID Sub-TLV, if present.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add SRv6 End.X SID to IS ext reach Sub-TLVs
Carmine Scarpitta [Thu, 25 May 2023 10:13:33 +0000 (12:13 +0200)]
isisd: Add SRv6 End.X SID to IS ext reach Sub-TLVs

Add SRv6 End.X SID Sub-TLV and SRv6 LAN End.X SID Sub-TLV to the
Extended IS Reachability Sub-TLVs data structure and perform proper
initialization/free when the Sub-TLVs data structure is
allocated/destroyed.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add SRv6 LAN End.X SID Sub-TLV data struct
Carmine Scarpitta [Thu, 25 May 2023 09:50:18 +0000 (11:50 +0200)]
isisd: Add SRv6 LAN End.X SID Sub-TLV data struct

Add a data structure to represent an SRv6 LAN End.X SID Sub-TLV as per
RFC 9352 section #8.2.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add SRv6 End.X SID Sub-TLV data structure
Carmine Scarpitta [Thu, 25 May 2023 09:49:47 +0000 (11:49 +0200)]
isisd: Add SRv6 End.X SID Sub-TLV data structure

Add a data structure to represent an SRv6 End.X SID Sub-TLV as per
RFC 9352 section #8.1.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Update copyright info in isis_tlvs.[c,h]
Carmine Scarpitta [Sat, 18 Feb 2023 00:36:32 +0000 (01:36 +0100)]
isisd: Update copyright info in isis_tlvs.[c,h]

Add copyright claim for "IS-IS Extensions to Support SRv6" (RFC 9352)
to isis_tlvs.c and isis_tlvs.h.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Advertise SRv6 Locator in Prefix Reach TLV
Carmine Scarpitta [Tue, 6 Dec 2022 20:54:25 +0000 (21:54 +0100)]
isisd: Advertise SRv6 Locator in Prefix Reach TLV

According to RFC 9352 section #5, the SRv6 Locators associated with
algorithms 0 and 1 should be also advertised in a Prefix Reachability
TLV (236 or 237) to allow legacy routers (i.e., routers that do not
support SRv6) installing a forwarding entry for algorithms 0 and 1 SRv6
traffic.

This commits extend IS-IS to advertise SRv6 Locators in IPv6
Reachability TLV.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add SRv6 Locator TLV to the LSP
Carmine Scarpitta [Wed, 22 Feb 2023 00:25:12 +0000 (01:25 +0100)]
isisd: Add SRv6 Locator TLV to the LSP

Add the SRv6 Locator TLV and its Sub-TLV and Sub-Sub-TLVs to the LSP.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add structure when building End SID Sub-TLV
Carmine Scarpitta [Wed, 15 Feb 2023 11:27:53 +0000 (12:27 +0100)]
isisd: Add structure when building End SID Sub-TLV

Encode SRv6 SID Structure Sub-Sub-TLV when building the SRv6 End SID
Sub-TLV.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add func to build Sub-Sub-TLV from End SID
Carmine Scarpitta [Wed, 15 Feb 2023 11:00:24 +0000 (12:00 +0100)]
isisd: Add func to build Sub-Sub-TLV from End SID

Add a function to build an SRv6 SID Structure Sub-Sub-TLV (RFC 9352
section #9) to advertise the structure of a specific SRv6 End SID passed
as an argument.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add End SID when building SRv6 Locator TLV
Carmine Scarpitta [Thu, 16 Mar 2023 09:24:04 +0000 (10:24 +0100)]
isisd: Add End SID when building SRv6 Locator TLV

Encode SRv6 End SID Sub-TLVs when building the SRv6 Locator TLV.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add func to build Sub-TLV from SRv6 End SID
Carmine Scarpitta [Wed, 15 Feb 2023 11:15:45 +0000 (12:15 +0100)]
isisd: Add func to build Sub-TLV from SRv6 End SID

Add a function to build an SRv6 End SID TLV (RFC 9352 section #7.2) to
advertise a specific SRv6 End SID passed as an argument.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add function to build TLV from SRv6 Locator
Carmine Scarpitta [Fri, 24 Feb 2023 21:27:25 +0000 (22:27 +0100)]
isisd: Add function to build TLV from SRv6 Locator

Add a function to build an SRv6 Locator TLV (RFC 9352 section #7.1) to
advertise a specific SRv6 Locator passed as an argument.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add func to fill in SID Struct Sub-Sub-TLV
Carmine Scarpitta [Wed, 15 Feb 2023 10:49:11 +0000 (11:49 +0100)]
isisd: Add func to fill in SID Struct Sub-Sub-TLV

Add a function to fill in an SRv6 SID Structure Sub-Sub-TLV with
information from an SRv6 SID (RFC 9352 section #9).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add func to fill in an SRv6 End SID Sub-TLV
Carmine Scarpitta [Wed, 15 Feb 2023 10:43:03 +0000 (11:43 +0100)]
isisd: Add func to fill in an SRv6 End SID Sub-TLV

Add a function to fill in an SRv6 End SID Sub-TLV with information from
an SRv6 End SID (RFC 9352 section #7.2).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add function to fill in an SRv6 Locator TLV
Carmine Scarpitta [Wed, 15 Feb 2023 10:35:46 +0000 (11:35 +0100)]
isisd: Add function to fill in an SRv6 Locator TLV

Add a function to fill in an SRv6 Locator TLV with information from an
SRv6 locator (RFC 9352 section #7.1).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add SRv6 locator data structure
Carmine Scarpitta [Wed, 15 Feb 2023 10:23:34 +0000 (11:23 +0100)]
isisd: Add SRv6 locator data structure

Add a data structure to represent an SRv6 locator (RFC 9352
section 7.1)

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Bind SRv6 SID Struct ops to TLV type
Carmine Scarpitta [Wed, 15 Feb 2023 12:28:25 +0000 (13:28 +0100)]
isisd: Bind SRv6 SID Struct ops to TLV type

General Sub-Sub-TLV processing functions (i.e., copy, format, free,
pack, and unpack) perform a lookup of the handler specific for a
Sub-Sub-TLV in the `tlv_table`, and then call the specific handler to
process the Sub-Sub-TLV.
This commit adds the handlers for the SRv6 Structure Sub-Sub-TLV (stored
in `subsubtlv_srv6_sid_structure_ops`) to the `tlv_table`.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Define TLV ops for SID Struct Sub-Sub-TLV
Carmine Scarpitta [Wed, 15 Feb 2023 12:27:41 +0000 (13:27 +0100)]
isisd: Define TLV ops for SID Struct Sub-Sub-TLV

Use the SUBSUBTLV_OPS macro to define the TLV operations for the SRv6
SID Structure Sub-Sub-TLV (RFC 9352 section #9).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add unpack func for SID Struct Sub-Sub-TLV
Carmine Scarpitta [Tue, 14 Feb 2023 15:24:56 +0000 (16:24 +0100)]
isisd: Add unpack func for SID Struct Sub-Sub-TLV

Add a function to unpack an SRv6 SID Structure Sub-Sub-TLV
(RFC 9352 section #9).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Pack SID Struct when packing Sub-Sub-TLVs
Carmine Scarpitta [Sun, 12 Mar 2023 20:27:54 +0000 (21:27 +0100)]
isisd: Pack SID Struct when packing Sub-Sub-TLVs

Extend generic Sub-Sub-TLVs pack function to pack SRv6 SID Structure
Sub-Sub-TLVs (RFC 9352 section FRRouting#9).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add pack func for SID Structure Sub-Sub-TLV
Carmine Scarpitta [Tue, 14 Feb 2023 15:03:58 +0000 (16:03 +0100)]
isisd: Add pack func for SID Structure Sub-Sub-TLV

Add a function to pack an SRv6 SID Structure Sub-Sub-TLV
(RFC 9352 section #9).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Free SID Struct when freeing Sub-Sub-TLVs
Carmine Scarpitta [Sat, 11 Mar 2023 10:55:03 +0000 (11:55 +0100)]
isisd: Free SID Struct when freeing Sub-Sub-TLVs

Extend generic Sub-Sub-TLVs free function to free SRv6 SID Structure
Sub-Sub-TLVs (RFC 9352 section #9).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add free func for SID Structure Sub-Sub-TLV
Carmine Scarpitta [Wed, 1 Mar 2023 15:42:26 +0000 (16:42 +0100)]
isisd: Add free func for SID Structure Sub-Sub-TLV

Add a function to free an SRv6 SID Structure Sub-Sub-TLV
(RFC 9352 section #9).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add SID Struct to Sub-Sub-TLVs format func
Carmine Scarpitta [Sat, 11 Mar 2023 10:55:47 +0000 (11:55 +0100)]
isisd: Add SID Struct to Sub-Sub-TLVs format func

Extend generic Sub-Sub-TLVs format function to return information about
SRv6 SID Structure Sub-Sub-TLVs (RFC 9352 section #9).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add format func for SID Struct Sub-Sub-TLV
Carmine Scarpitta [Wed, 1 Mar 2023 15:42:56 +0000 (16:42 +0100)]
isisd: Add format func for SID Struct Sub-Sub-TLV

Add a function to return information about an SRv6 SID Structure
Sub-Sub-TLV (RFC 9352 section #9).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Copy SID Struct when copying Sub-Sub-TLVs
Carmine Scarpitta [Sat, 11 Mar 2023 10:57:05 +0000 (11:57 +0100)]
isisd: Copy SID Struct when copying Sub-Sub-TLVs

Extend generic Sub-Sub-TLVs copy function to copy SRv6 SID Structure
Sub-Sub-TLVs (RFC 9352 section #9).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add copy func for SID Structure Sub-Sub-TLV
Carmine Scarpitta [Tue, 14 Feb 2023 14:52:01 +0000 (15:52 +0100)]
isisd: Add copy func for SID Structure Sub-Sub-TLV

Add a function to copy an SRv6 SID Structure Sub-Sub-TLV
(RFC 9352 section #9).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add data struct for SID Struct Sub-Sub-TLV
Carmine Scarpitta [Sun, 12 Mar 2023 22:38:48 +0000 (23:38 +0100)]
isisd: Add data struct for SID Struct Sub-Sub-TLV

Add a data structure representing the SRv6 SID Structure Sub-Sub-TLV
(RFC 9352 section #9).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Unpack Sub-Sub-TLVs of SRv6 End SID Sub-TLV
Carmine Scarpitta [Sat, 11 Mar 2023 11:05:37 +0000 (12:05 +0100)]
isisd: Unpack Sub-Sub-TLVs of SRv6 End SID Sub-TLV

Extend SRv6 End SID Sub-TLV unpack function to unpack Sub-Sub-TLVs (RFC
9352 section #9).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Pack Sub-Sub-TLVs of SRv6 End SID Sub-TLV
Carmine Scarpitta [Sat, 3 Jun 2023 10:11:27 +0000 (12:11 +0200)]
isisd: Pack Sub-Sub-TLVs of SRv6 End SID Sub-TLV

Extend SRv6 End SID Sub-TLV pack function to pack Sub-Sub-TLVs (RFC 9352
section #9).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Free Sub-Sub-TLVs of SRv6 End SID Sub-TLV
Carmine Scarpitta [Sat, 11 Mar 2023 11:01:58 +0000 (12:01 +0100)]
isisd: Free Sub-Sub-TLVs of SRv6 End SID Sub-TLV

Extend SRv6 End SID Sub-TLV free function to free Sub-Sub-TLVs (RFC 9352
section #9).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add Sub-Sub-TLVs to End SID format func
Carmine Scarpitta [Sat, 11 Mar 2023 11:01:07 +0000 (12:01 +0100)]
isisd: Add Sub-Sub-TLVs to End SID format func

Extend SRv6 End SID Sub-TLV format function to return information about
Sub-Sub-TLVs (RFC 9352 section #7.2).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Copy Sub-Sub-TLVs of SRv6 End SID Sub-TLV
Carmine Scarpitta [Sat, 11 Mar 2023 11:00:01 +0000 (12:00 +0100)]
isisd: Copy Sub-Sub-TLVs of SRv6 End SID Sub-TLV

Extend SRv6 End SID Sub-TLV copy function to copy Sub-Sub-TLVs (RFC 9352
section #7.2).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add pack func for Sub-Sub-TLVs in general
Carmine Scarpitta [Sun, 12 Mar 2023 20:19:12 +0000 (21:19 +0100)]
isisd: Add pack func for Sub-Sub-TLVs in general

Add a function to pack all the Sub-Sub-TLVs passed as an argument.

At this time, this function does not pack any Sub-Sub-TLVs because no
Sub-Sub-TLVs have been defined yet. This function will be extended in
future commits to pack specific Sub-Sub-TLVs, as they become supported.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add free func for Sub-Sub-TLVs in general
Carmine Scarpitta [Fri, 17 Feb 2023 22:27:07 +0000 (23:27 +0100)]
isisd: Add free func for Sub-Sub-TLVs in general

Add a function to free all the Sub-Sub-TLVs and the `isis_subsubtlvs`
data structure passed as an argument.

At this time, this function only frees the `isis_subsubtlvs`. It does
not free any specific Sub-Sub-TLVs because no Sub-Sub-TLVs have been
defined yet. This function will be extended in future commits to free
specific Sub-Sub-TLVs, as they become supported.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add format func for Sub-Sub-TLVs in general
Carmine Scarpitta [Wed, 1 Mar 2023 15:46:57 +0000 (16:46 +0100)]
isisd: Add format func for Sub-Sub-TLVs in general

Add a function to return information about all the Sub-Sub-TLVs passed
as an argument.

At this time, this function does nothing because no Sub-Sub-TLVs have
been defined yet. This function will be extended in
future commits to return information about specific Sub-Sub-TLVs,
as they become supported.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add copy func for Sub-Sub-TLVs in general
Carmine Scarpitta [Tue, 14 Feb 2023 14:50:48 +0000 (15:50 +0100)]
isisd: Add copy func for Sub-Sub-TLVs in general

Add a function to copy all the Sub-Sub-TLVs passed as an argument.

At this time, this function does not copy any Sub-Sub-TLVs because no
Sub-Sub-TLVs have been defined yet. This function will be extended in
future commits to copy specific Sub-Sub-TLVs, as they become supported.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add alloc func for Sub-Sub-TLVs in general
Carmine Scarpitta [Sat, 3 Jun 2023 00:41:36 +0000 (02:41 +0200)]
isisd: Add alloc func for Sub-Sub-TLVs in general

Add a function to allocate memory for IS-IS Sub-Sub-TLVs.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add struct to store Sub-Sub-TLVs info
Carmine Scarpitta [Fri, 24 Feb 2023 21:37:18 +0000 (22:37 +0100)]
isisd: Add struct to store Sub-Sub-TLVs info

Add a data structure to store IS-IS Sub-Sub-TLVs information. At this
time, does not contain any Sub-Sub-TLV information because no
Sub-Sub-TLVs have been defined yet. This data structure will be extended
in future commits to store specific Sub-Sub-TLVs, as they become
supported.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add new macros to define Sub-Sub-TLV ops
Carmine Scarpitta [Tue, 14 Feb 2023 14:43:52 +0000 (15:43 +0100)]
isisd: Add new macros to define Sub-Sub-TLV ops

Add two macros `SUBSUBTLV_OPS` and `ITEM_SUBSUBTLV_OPS` that help the
developer to define the TLV operations for the IS-IS Sub-Sub-TLVs.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Pack SRv6 End SID when packing Sub-TLVs
Carmine Scarpitta [Tue, 14 Feb 2023 11:52:30 +0000 (12:52 +0100)]
isisd: Pack SRv6 End SID when packing Sub-TLVs

Extend generic Sub-TLVs pack function to pack SRv6 End SID Sub-TLVs
(RFC 9352 section #7.2).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Free SRv6 End SID when freeing Sub-TLVs
Carmine Scarpitta [Tue, 14 Feb 2023 11:51:17 +0000 (12:51 +0100)]
isisd: Free SRv6 End SID when freeing Sub-TLVs

Extend generic Sub-TLVs free function to free SRv6 End SID Sub-TLVs
(RFC 9352 section #7.2).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add SRv6 End SID to Sub-TLVs format func
Carmine Scarpitta [Tue, 14 Feb 2023 11:50:19 +0000 (12:50 +0100)]
isisd: Add SRv6 End SID to Sub-TLVs format func

Extend generic Sub-TLVs format function to return information about
SRv6 End SID Sub-TLVs (RFC 9352 section #7.2).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Copy SRv6 End SID when copying Sub-TLVs
Carmine Scarpitta [Tue, 14 Feb 2023 11:49:09 +0000 (12:49 +0100)]
isisd: Copy SRv6 End SID when copying Sub-TLVs

Extend generic Sub-TLVs copy function to copy SRv6 End SID Sub-TLVs
(RFC 9352 section #7.2).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Bind SRv6 End SID Sub-TLV ops to TLV type
Carmine Scarpitta [Wed, 15 Feb 2023 12:28:06 +0000 (13:28 +0100)]
isisd: Bind SRv6 End SID Sub-TLV ops to TLV type

General Sub-TLV processing functions (i.e., copy, format, free, pack,
and unpack) perform a lookup of the specific handler for a Sub-TLV in
the `tlv_table`, and then call the specific handler to process the
Sub-TLV.
This commit adds the handlers for the SRv6 End SID Sub-TLV (stored in
`tlv_srv6_end_sid_ops`) to the `tlv_table`.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Define TLV ops for SRv6 End SID Sub-TLV
Carmine Scarpitta [Tue, 14 Feb 2023 14:44:47 +0000 (15:44 +0100)]
isisd: Define TLV ops for SRv6 End SID Sub-TLV

Use the ITEM_SUBTLV_OPS macro to define the TLV operations for the SRv6
End SID Sub-TLV (RFC 9352 section #7.2).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add unpack func for SRv6 End SID Sub-TLV
Carmine Scarpitta [Tue, 21 Feb 2023 18:47:03 +0000 (19:47 +0100)]
isisd: Add unpack func for SRv6 End SID Sub-TLV

Add a function to unpack an SRv6 End SID Sub-TLV
(RFC 9352 section FRRouting#7.2).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agobgpd: Ensure that leak_update does not free memory before it is being used
Donald Sharp [Sun, 10 Sep 2023 13:56:53 +0000 (09:56 -0400)]
bgpd: Ensure that leak_update does not free memory before it is being used

The unlock may cause the bgp_process to use dest.  Ensure that this
does not happen.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agobgpd: bgp_afi_node_get teach coverity about unlocking
Donald Sharp [Sun, 10 Sep 2023 13:55:24 +0000 (09:55 -0400)]
bgpd: bgp_afi_node_get teach coverity about unlocking

The pdest pointer is locked by the bgp_node_get so
unlocking it should be fine and it should still exist.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agobgpd: In bgp_clear_route_table ensure dest is still usable.
Donald Sharp [Sun, 10 Sep 2023 13:53:54 +0000 (09:53 -0400)]
bgpd: In bgp_clear_route_table ensure dest is still usable.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agobgpd: bgp_best_selection ensure dest still exists
Donald Sharp [Sun, 10 Sep 2023 13:51:34 +0000 (09:51 -0400)]
bgpd: bgp_best_selection ensure dest still exists

When reaping the dest ensure that it still exists as that
it should be locked by the calling function.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agobgpd: Ensure bgp_aggregate_unset does dest good
Donald Sharp [Sun, 10 Sep 2023 13:49:34 +0000 (09:49 -0400)]
bgpd: Ensure bgp_aggregate_unset does dest good

dest could be freed by the first unlock, but should
not be due to our locking structure.  Ensure coverity
understands this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agobgpd: Ensure bgp_redistribute_withdraw dest is usable still
Donald Sharp [Sun, 10 Sep 2023 13:47:44 +0000 (09:47 -0400)]
bgpd: Ensure bgp_redistribute_withdraw dest is usable still

Same story dest is locked during table walk.  ensure coverity
understands this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agobgpd: Ensure debug is printed before possible dest freed in install_evpn_route_entry_...
Donald Sharp [Sun, 10 Sep 2023 13:46:25 +0000 (09:46 -0400)]
bgpd: Ensure debug is printed before possible dest freed in install_evpn_route_entry_in_vrf

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agobgpd: bgp_static_set ensure dest is still usable.
Donald Sharp [Sun, 10 Sep 2023 13:45:15 +0000 (09:45 -0400)]
bgpd: bgp_static_set ensure dest is still usable.

Again coverity thinks dest may be freed on the first
call but it should not be.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agobgpd: bgp_cleanup_table ensure dest is still usable.
Donald Sharp [Sun, 10 Sep 2023 13:43:33 +0000 (09:43 -0400)]
bgpd: bgp_cleanup_table ensure dest is still usable.

Make coverity happy

Signed-off-by: Donald Sharp <sharpd@nvidia.com>