]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
9 months agobgpd: Convert int to enum peer_asn_type 16345/head
Donatas Abraitis [Thu, 4 Jul 2024 20:07:01 +0000 (23:07 +0300)]
bgpd: Convert int to enum peer_asn_type

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
9 months agobgpd: Implement `neighbor X remote-as auto`
Donatas Abraitis [Thu, 4 Jul 2024 11:42:19 +0000 (14:42 +0300)]
bgpd: Implement `neighbor X remote-as auto`

In some cases (large scale) it's desired to avoid changing configurations, but
let the BGP to automatically handle ASN changes.

`auto` means the peering can be iBGP or eBGP. It will be automatically detected
and adjusted from the OPEN message.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
9 months agoMerge pull request #16333 from opensourcerouting/fix/nits
Donald Sharp [Wed, 3 Jul 2024 12:43:23 +0000 (08:43 -0400)]
Merge pull request #16333 from opensourcerouting/fix/nits

bgpd: Drop memset() before encoding EVPN extended communities

9 months agoMerge pull request #16331 from opensourcerouting/feature/bgp_dampening_topotests
Russ White [Wed, 3 Jul 2024 11:23:09 +0000 (07:23 -0400)]
Merge pull request #16331 from opensourcerouting/feature/bgp_dampening_topotests

tests: Add basic BGP per-safi dampening topotest

9 months agoMerge pull request #16226 from anlancs/ldpd/fix-gtsm
Russ White [Tue, 2 Jul 2024 17:49:12 +0000 (13:49 -0400)]
Merge pull request #16226 from anlancs/ldpd/fix-gtsm

ldpd: fix wrong gtsm count

9 months agobgpd: Drop memset() before encoding EVPN extended communities 16333/head
Donatas Abraitis [Tue, 2 Jul 2024 15:35:48 +0000 (18:35 +0300)]
bgpd: Drop memset() before encoding EVPN extended communities

memset() is already handled inside the helpers for a particular extended
community.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
9 months agotests: Add basic BGP per-safi dampening topotest 16331/head
Donatas Abraitis [Tue, 2 Jul 2024 14:57:06 +0000 (17:57 +0300)]
tests: Add basic BGP per-safi dampening topotest

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
9 months agoMerge pull request #16099 from Pdoijode/pdoijode/bgp-gr2
Donatas Abraitis [Tue, 2 Jul 2024 14:40:29 +0000 (16:40 +0200)]
Merge pull request #16099 from Pdoijode/pdoijode/bgp-gr2

Implement BGP-wide configuration for graceful restart

9 months agoMerge pull request #15677 from cscarpitta/isis-srv6-sid-manager
Russ White [Tue, 2 Jul 2024 12:32:05 +0000 (08:32 -0400)]
Merge pull request #15677 from cscarpitta/isis-srv6-sid-manager

isisd: Extend IS-IS to communicate with the SRv6 SID Manager to allocate/release SRv6 SIDs

9 months agoMerge pull request #16303 from zhou-run/202406271017
Russ White [Tue, 2 Jul 2024 12:01:25 +0000 (08:01 -0400)]
Merge pull request #16303 from zhou-run/202406271017

isisd: fix crash when obtaining the next hop to calculate LFA on LAN links

9 months agoMerge pull request #16094 from opensourcerouting/pkgs-with-grpc
Russ White [Tue, 2 Jul 2024 11:36:50 +0000 (07:36 -0400)]
Merge pull request #16094 from opensourcerouting/pkgs-with-grpc

Add option to build pkg with grpc support

9 months agoMerge pull request #15716 from zhou-run/202404092101
Russ White [Tue, 2 Jul 2024 11:25:51 +0000 (07:25 -0400)]
Merge pull request #15716 from zhou-run/202404092101

isisd: Fix memory leaks when the transition of neighbor state from non-UP to DOWN

9 months ago*: Add and use option for graceful (re)start 16099/head
vivek [Wed, 26 Jun 2024 22:49:45 +0000 (15:49 -0700)]
*: Add and use option for graceful (re)start

Add a new start option "-K" to libfrr to denote a graceful start,
and use it in zebra and bgpd.

zebra will use this option to denote a planned FRR graceful restart
(supporting only bgpd currently) to wait for a route sync completion
from bgpd before cleaning up old stale routes from the FIB. An optional
timer provides an upper-bounds for this cleanup.

bgpd will use this option to denote either a planned FRR graceful
restart or a bgpd-only graceful restart, and this will drive the BGP
GR restarting router procedures.

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
9 months agotests: Updated topotest and documentation
Pooja Jagadeesh Doijode [Thu, 27 Jun 2024 00:34:44 +0000 (17:34 -0700)]
tests: Updated topotest and documentation

Added topotest and documentation for BGP wide GR configurations

Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
9 months agobgpd: Refine debug logs for zebra GR registration
vivek [Mon, 26 Oct 2020 04:54:13 +0000 (21:54 -0700)]
bgpd: Refine debug logs for zebra GR registration

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
9 months agobgpd: Enhance OPEN Tx debug log
vivek [Mon, 26 Oct 2020 04:21:55 +0000 (21:21 -0700)]
bgpd: Enhance OPEN Tx debug log

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
9 months agobgpd: Refine OPEN debug logs for graceful restart
vivek [Mon, 26 Oct 2020 04:16:32 +0000 (21:16 -0700)]
bgpd: Refine OPEN debug logs for graceful restart

This also fixes Rx F-bit log which was incorrect.

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
9 months agobgpd: Refine restarter operation - R-bit & F-bit
vivek [Mon, 26 Oct 2020 00:05:48 +0000 (17:05 -0700)]
bgpd: Refine restarter operation - R-bit & F-bit

Introduce BGP-wide flags to denote if BGP has started gracefully
and GR is in progress or not. Use this for setting of the R-bit in
the GR capability, and not a timer which is set for any new
instance creation. Mark graceful restart is complete when the
deferred path selection has been done and route sync with zebra as
well as deferred EOR advertisement has been initiated.

Introduce a function to check on F-bit setting rather than just
base it on configuration.

Subsequent commits will extend these functionalities.

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
9 months agoMerge pull request #16233 from T-Nicolas/patch-1
Donatas Abraitis [Mon, 1 Jul 2024 17:36:57 +0000 (19:36 +0200)]
Merge pull request #16233 from T-Nicolas/patch-1

ripd/ripd.c - rip_auth_md5 : Change the start value of sequence 1 to 0

9 months agoMerge pull request #16305 from opensourcerouting/fix/bgp_confederation_rfc8212
Donald Sharp [Mon, 1 Jul 2024 14:18:10 +0000 (10:18 -0400)]
Merge pull request #16305 from opensourcerouting/fix/bgp_confederation_rfc8212

bgpd: Ignore RFC8212 for BGP Confederations

10 months agoMerge pull request #16068 from piotrsuchy/unknown_VRF
Donatas Abraitis [Fri, 28 Jun 2024 08:33:40 +0000 (10:33 +0200)]
Merge pull request #16068 from piotrsuchy/unknown_VRF

bgpd: Ignore routes from evpn if VRF is unknown

10 months agoMerge pull request #14509 from qlyoung/fix-clicmd-duplicates-issue
Christian Hopps [Fri, 28 Jun 2024 00:14:46 +0000 (20:14 -0400)]
Merge pull request #14509 from qlyoung/fix-clicmd-duplicates-issue

doc: add ability to disambiguate clicmds

10 months agoMerge pull request #16297 from qlyoung/doc-toc-sections
Christian Hopps [Thu, 27 Jun 2024 23:52:19 +0000 (19:52 -0400)]
Merge pull request #16297 from qlyoung/doc-toc-sections

doc: improve table-of-contents organization

10 months agotests: Test if RFC 8212 is not involved for BGP confederations 16305/head
Donatas Abraitis [Thu, 27 Jun 2024 19:53:24 +0000 (22:53 +0300)]
tests: Test if RFC 8212 is not involved for BGP confederations

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
10 months agobgpd: Ignore RFC8212 for BGP Confederations
Donatas Abraitis [Thu, 27 Jun 2024 19:46:58 +0000 (22:46 +0300)]
bgpd: Ignore RFC8212 for BGP Confederations

RFC 8212 should be restricted for eBGP peers.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
10 months agodoc: do not use custom directive on old sphinx 14509/head
Quentin Young [Wed, 26 Jun 2024 22:17:07 +0000 (18:17 -0400)]
doc: do not use custom directive on old sphinx

Not supported.

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
10 months agodoc: add ability to disambiguate clicmds
Quentin Young [Fri, 29 Sep 2023 00:11:31 +0000 (20:11 -0400)]
doc: add ability to disambiguate clicmds

Multiple daemons have the same CLI commands defined, but the current
directive used to document CLI commands only takes the command
definition string. Since CLI command objects can be cross-referenced
using the :clicmd: directive, and are placed in the index, each object
needs to be unique.

To accomplish this, add a custom directive. This directive extends the
directive class used by sphinx's add_object_type to add a :daemon:
option. By specifying this option where needed, the object name becomes
"(<daemon>) <definition>", disambiguating it.

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
10 months agobgpd: Streamline GR config, act on change immediately
vivek [Sun, 25 Oct 2020 18:31:42 +0000 (11:31 -0700)]
bgpd: Streamline GR config, act on change immediately

Streamline the BGP graceful-restart configuration at the global and
peer level some more. Similar to many other neighbor capability
parameters like MP and ENHE, reset the session immediately upon a
change to the configuration. This will be more aligned with the
transactional UI model also and will not require a separate 'clear'
command to be executed.

Note: Peer-group graceful-restart configuration is not yet supported.

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
10 months agobgpd: Added ! after BGP global config
Pooja Jagadeesh Doijode [Wed, 29 May 2024 21:14:20 +0000 (14:14 -0700)]
bgpd: Added ! after BGP global config

Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
10 months agobgpd: Implement BGP-wide configuration for graceful restart
vivek [Sat, 24 Oct 2020 21:38:58 +0000 (14:38 -0700)]
bgpd: Implement BGP-wide configuration for graceful restart

Add support for a BGP-wide setting for graceful restart modes and
parameters. This setting will apply to all BGP peers across all BGP
instances, but per-neighbor configuration can override it.
Per-instance configuration is disallowed if the BGP-wide setting
is in effect.

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
10 months agoMerge pull request #16301 from qlyoung/reformat-sphinx-config-files
Christian Hopps [Thu, 27 Jun 2024 18:39:02 +0000 (14:39 -0400)]
Merge pull request #16301 from qlyoung/reformat-sphinx-config-files

doc: reformat Sphinx conf.py files

10 months agoMerge pull request #16299 from opensourcerouting/pim-logic-braces-20240625
Donald Sharp [Thu, 27 Jun 2024 18:00:47 +0000 (14:00 -0400)]
Merge pull request #16299 from opensourcerouting/pim-logic-braces-20240625

pimd: fix misplaced braces/logic error in pim_rp_set_upstream_addr

10 months agoripd: Change the start value of sequence 1 to 0 16233/head
T-Nicolas [Mon, 17 Jun 2024 13:05:58 +0000 (15:05 +0200)]
ripd: Change the start value of sequence 1 to 0

Signed-off-by: T-Nicolas <github@toselli.email>
10 months agoisisd: fix crash when obtaining the next hop to calculate LFA on LAN links 16303/head
zhou-run [Thu, 27 Jun 2024 03:51:02 +0000 (11:51 +0800)]
isisd: fix crash when obtaining the next hop to calculate LFA on LAN links

When a neighbor connection is disconnected, it may trigger LSP re-generation as a timer task, but this process may be delayed. As a result, the list of neighbors in area->adjacency_list may be inconsistent with the neighbors in lsp->tlvs->oldstyle_reach/extended_reach. For example, the area->adjacency_list may lack certain neighbors even though they are present in the LSP. When computing SPF, the call to isis_spf_build_adj_list() generates the spftree->sadj_list, which reflects the real neighbors in the area->adjacency_list. However, in the case of LAN links, spftree->sadj_list may include additional pseudo neighbors.
The pre-loading of tents through the call to isis_spf_preload_tent involves two steps:
1. isis_spf_process_lsp() is called to generate real neighbor vertices based on the root LSP and pseudo LSP.
2. isis_spf_add_local() is called to add corresponding next hops to the vertex->Adj_N list for the real neighbor vertices.
In the case of LAN links, the absence of corresponding real neighbors in the spftree->sadj_list prevents the execution of the second step. Consequently, the vertex->Adj_N list for the real neighbor vertices lacks corresponding next hops. This leads to a null pointer access when isis_lfa_compute() is called to calculate LFA.
As for P2P links, since there are no pseudo neighbors, only the second step is executed, which does not create real neighbor vertices and therefore does not encounter this issue.
The backtrace is as follows:
(gdb) bt
#0  0x00007fd065277fe1 in raise () from /lib/x86_64-linux-gnu/libpthread.so.0
#1  0x00007fd065398972 in core_handler (signo=11, siginfo=0x7ffc5c0636b0, context=0x7ffc5c063580) at ../lib/sigevent.c:261
#2  <signal handler called>
#3  0x00005564d82f8408 in isis_lfa_compute (area=0x5564d8b143f0, circuit=0x5564d8b21d10, spftree=0x5564d8b06bf0, resource=0x7ffc5c064410) at ../isisd/isis_lfa.c:2134
#4  0x00005564d82f8d78 in isis_spf_run_lfa (area=0x5564d8b143f0, spftree=0x5564d8b06bf0) at ../isisd/isis_lfa.c:2344
#5  0x00005564d8315964 in isis_run_spf_with_protection (area=0x5564d8b143f0, spftree=0x5564d8b06bf0) at ../isisd/isis_spf.c:1827
#6  0x00005564d8315c15 in isis_run_spf_cb (thread=0x7ffc5c064590) at ../isisd/isis_spf.c:1889
#7  0x00007fd0653b1f04 in thread_call (thread=0x7ffc5c064590) at ../lib/thread.c:1990
#8  0x00007fd06534a97b in frr_run (master=0x5564d88103c0) at ../lib/libfrr.c:1198
#9  0x00005564d82e7d5d in main (argc=5, argv=0x7ffc5c0647b8, envp=0x7ffc5c0647e8) at ../isisd/isis_main.c:273
(gdb) f 3
#3  0x00005564d82f8408 in isis_lfa_compute (area=0x5564d8b143f0, circuit=0x5564d8b21d10, spftree=0x5564d8b06bf0, resource=0x7ffc5c064410) at ../isisd/isis_lfa.c:2134
2134    ../isisd/isis_lfa.c: No such file or directory.
(gdb) p vadj_primary
$1 = (struct isis_vertex_adj *) 0x0
(gdb) p vertex->Adj_N->head
$2 = (struct listnode *) 0x0
(gdb) p (struct isis_vertex *)spftree->paths->l.list->head->next->next->next->next->data
$8 = (struct isis_vertex *) 0x5564d8b5b240
(gdb) p $8->type
$9 = VTYPE_NONPSEUDO_TE_IS
(gdb) p $8->N.id
$10 = "\000\000\000\000\000\002"
(gdb) p $8->Adj_N->count
$11 = 0
(gdb) p (struct isis_vertex *)spftree->paths->l.list->head->next->next->next->next->next->data
$12 = (struct isis_vertex *) 0x5564d8b73dd0
(gdb) p $12->type
$13 = VTYPE_NONPSEUDO_TE_IS
(gdb) p $12->N.id
$14 = "\000\000\000\000\000\003"
(gdb) p $12->Adj_N->count
$15 = 0
(gdb) p area->adjacency_list->count
$16 = 0
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.
The scenario where a vertex has no next hop is normal. For example, the "clear isis neighbor" command invokes isis_vertex_adj_del() to delete the next hop of a vertex. Upon reviewing all the instances where the vertex->Adj_N list is used, I found that only isis_lfa_compute() lacks a null check. Therefore, I believe that modifying this part will be sufficient. Additionally, the vertex->parents list for IP vertices is guaranteed not to be empty.
Test scenario:
Setting up LFA for LAN links and executing the "clear isis neighbor" command easily reproduces the issue.

Signed-off-by: zhou-run <zhou.run@h3c.com>
10 months agoMerge pull request #16271 from lsang6WIND/avoid-loop
Russ White [Wed, 26 Jun 2024 20:45:44 +0000 (16:45 -0400)]
Merge pull request #16271 from lsang6WIND/avoid-loop

bgpd: avoid clearing routes for peers that were never established

10 months agodoc: reformat Sphinx conf.py files 16301/head
Quentin Young [Wed, 26 Jun 2024 19:44:08 +0000 (15:44 -0400)]
doc: reformat Sphinx conf.py files

Style checking is complaining about these, rightly so. Reformat.

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
10 months agopimd: refactor `pim_rp_set_upstream_addr` 16299/head
David Lamparter [Wed, 26 Jun 2024 14:13:50 +0000 (16:13 +0200)]
pimd: refactor `pim_rp_set_upstream_addr`

Somehow this tiny function ended up being written in a very convoluted
way that enabled the braces mixup in the previous commit.  Rewrite it to
be less confusing.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
10 months agopimd: fix misplaced braces/logic error
David Lamparter [Tue, 25 Jun 2024 12:37:27 +0000 (14:37 +0200)]
pimd: fix misplaced braces/logic error

The `!rp_info ||` check got added during a cleanup pass.  Unfortunately
the braces/and/or combination is not correct :(

Fixes: b1945363fbf ("pimd: Various buffer overflow reads and crashes")
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
10 months agobgpd: avoid clearing routes for peers that were never established 16271/head
Loïc Sang [Wed, 19 Jun 2024 14:19:22 +0000 (16:19 +0200)]
bgpd: avoid clearing routes for peers that were never established

Under heavy system load with many peers in passive mode and a large
number of routes, bgpd can enter an infinite loop. This occurs while
processing timeout BGP_OPEN messages, which prevents it from accepting
new connections. The following log entries illustrate the issue:
>bgpd[6151]: [VX6SM-8YE5W][EC 33554460] 3.3.2.224: nexthop_set failed, resetting connection - intf 0x0
>bgpd[6151]: [P790V-THJKS][EC 100663299] bgp_open_receive: bgp_getsockname() failed for peer: 3.3.2.224
>bgpd[6151]: [HTQD2-0R1WR][EC 33554451] bgp_process_packet: BGP OPEN receipt failed for peer: 3.3.2.224
... repeating

The issue occurs when bgpd handles a massive number of routes in the RIB
while receiving numerous BGP_OPEN packets. If bgpd is overloaded, it
fails to process these packets promptly, leading the remote peer to
close the connection and resend BGP_OPEN packets.

When bgpd eventually starts processing these timeout BGP_OPEN packets,
it finds the TCP connection closed by the remote peer, resulting in
"bgp_stop()" being called. For each timeout peer, bgpd must iterate
through the routing table, which is time-consuming and causes new
incoming BGP_OPEN packets to timeout, perpetuating the infinite loop.

To address this issue, the code is modified to check if the peer has
been established at least once before calling "bgp_clear_route_all()".
This ensures that routes are only cleared for peers that had a
successful session, preventing unnecessary iterations over the routing
table for peers that never established a connection.

With this change, BGP_OPEN timeout messages may still occur, but in the
worst case, bgpd will stabilize. Before this patch, bgpd could enter a
loop where it was unable to accpet any new connections.

Signed-off-by: Loïc Sang <loic.sang@6wind.com>
10 months agodoc: improve table-of-contents organization 16297/head
Quentin Young [Tue, 25 Jun 2024 17:48:33 +0000 (13:48 -0400)]
doc: improve table-of-contents organization

The current TOC organization is not really following Sphinx best
practices and is resulting in a jumble of articles showing up in the
sidebar.

This change primarily organizes existing articles into three major
sections:

* Introduction
  - Contains system requirements, architecture & design, installation,
    basic setup
* Basics
  - Covers basic commands, concepts, and some random things that don't
    fit elsewhere
* Protocols
  - Contains all protocol documentation, and other miscellaneous daemon
    docs such as those on Zebra, watchfrr, mgmtd, etc.

The appendix has been left as is, but the TOC now has a caption which
has the effect of adding a section separator in the nav sidebar.

In order to make the new structure make sense:

* Some content has been lifted up from the "Overview" page into the
  index page
* Most content has been pushed down from the "Overview" page into the
  "About" page (new)
* BFD's page is now titled "BFD" for consistencty; it was the only one
  that had the full protocol name written out in the title

And a couple drivebys:
* BFD's intro description paragraph was rewritten to make more sense
* Old language stating that we publish platform packages on the Github
  releases page was removed
* References to source building instructions were consolidated into that
  section

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
10 months agoMerge pull request #16182 from pguibert6WIND/isis_show_route_paths_json
Russ White [Tue, 25 Jun 2024 15:57:15 +0000 (11:57 -0400)]
Merge pull request #16182 from pguibert6WIND/isis_show_route_paths_json

Isis show route paths json

10 months agoMerge pull request #16214 from opensourcerouting/fix/attr_encap_handling
Russ White [Tue, 25 Jun 2024 11:26:38 +0000 (07:26 -0400)]
Merge pull request #16214 from opensourcerouting/fix/attr_encap_handling

bgpd: A couple more fixes for Tunnel encapsulation handling

10 months agoMerge pull request #16273 from opensourcerouting/fix/bgpd_oad_rfc8212
Russ White [Tue, 25 Jun 2024 11:24:42 +0000 (07:24 -0400)]
Merge pull request #16273 from opensourcerouting/fix/bgpd_oad_rfc8212

bgpd: Relax OAD (One-Administration-Domain) for RFC8212

10 months agoMerge pull request #16270 from cscarpitta/fix/fix-coverity-issues
Donatas Abraitis [Tue, 25 Jun 2024 05:53:13 +0000 (08:53 +0300)]
Merge pull request #16270 from cscarpitta/fix/fix-coverity-issues

zebra: Fix coverity issues

10 months agoMerge pull request #16261 from chiragshah6/evpn_dev4
Donatas Abraitis [Tue, 25 Jun 2024 05:07:17 +0000 (08:07 +0300)]
Merge pull request #16261 from chiragshah6/evpn_dev4

zebra: clear evpn dup-addr return error-msg when there is no vni

10 months agoMerge pull request #16267 from louis-6wind/fix-isis-srv6-json
Russ White [Mon, 24 Jun 2024 21:18:03 +0000 (17:18 -0400)]
Merge pull request #16267 from louis-6wind/fix-isis-srv6-json

isisd: fix crash in display srv6 sid structure in json

10 months agoMerge pull request #16222 from opensourcerouting/fix/docker_alpine_no_grpc
Russ White [Mon, 24 Jun 2024 21:16:51 +0000 (17:16 -0400)]
Merge pull request #16222 from opensourcerouting/fix/docker_alpine_no_grpc

docker: Adopt for Alpine Linux 3.20

10 months agoMerge pull request #15838 from fdumontet6WIND/fix_regexx_exclude
Russ White [Mon, 24 Jun 2024 21:08:17 +0000 (17:08 -0400)]
Merge pull request #15838 from fdumontet6WIND/fix_regexx_exclude

 bgpd: fix "bgp as-pah access-list" with "set aspath exclude" set/unset issue

10 months agoMerge pull request #16213 from opensourcerouting/fix/fqdn_capability_parsing_for_dyna...
Russ White [Mon, 24 Jun 2024 20:38:58 +0000 (16:38 -0400)]
Merge pull request #16213 from opensourcerouting/fix/fqdn_capability_parsing_for_dynamic_capability

bgpd: Check if we have really enough data before doing memcpy for FQDN capability

10 months agoMerge pull request #16211 from opensourcerouting/fix/dynamic_software_version_sanity_...
Russ White [Mon, 24 Jun 2024 20:38:50 +0000 (16:38 -0400)]
Merge pull request #16211 from opensourcerouting/fix/dynamic_software_version_sanity_check

bgpd: Check if we have really enough data before doing memcpy for software version

10 months agobgpd: Ignore routes from evpn if VRF is unknown 16068/head
Piotr Suchy [Wed, 22 May 2024 08:41:52 +0000 (10:41 +0200)]
bgpd: Ignore routes from evpn if VRF is unknown

Fix for a bug, where FRR fails to install route received for an unknown but later-created VRF - detailed description can be found here https://github.com/FRRouting/frr/issues/13708

Signed-off-by: Piotr Suchy <psuchy@akamai.com>
10 months agoMerge pull request #16242 from opensourcerouting/fix/shutdown_peer_last_reset
Russ White [Mon, 24 Jun 2024 19:40:49 +0000 (15:40 -0400)]
Merge pull request #16242 from opensourcerouting/fix/shutdown_peer_last_reset

bgpd: Set last reset reason to admin shutdown if it was manually

10 months agobgpd: Relax OAD (One-Administration-Domain) for RFC8212 16273/head
Donatas Abraitis [Mon, 24 Jun 2024 17:16:16 +0000 (20:16 +0300)]
bgpd: Relax OAD (One-Administration-Domain) for RFC8212

RFC 8212 defines leak prevention for eBGP peers, but BGP-OAD defines a new
peering type One Administrative Domain (OAD), where multiple ASNs could be used
inside a single administrative domain. OAD allows sending non-transitive attributes,
so this prevention should be relaxed too.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
10 months agoMerge pull request #16259 from opensourcerouting/pim-20240620-cand-rp-bsr-prep
Jafar Al-Gharaibeh [Mon, 24 Jun 2024 15:39:41 +0000 (11:39 -0400)]
Merge pull request #16259 from opensourcerouting/pim-20240620-cand-rp-bsr-prep

pimd: Candidate RP/BSR preparation

10 months agoisisd: fix srv6 endx sid key name 16267/head
Louis Scalbert [Mon, 24 Jun 2024 11:38:37 +0000 (13:38 +0200)]
isisd: fix srv6 endx sid key name

srv6EndSID is actually srv6EndXSID.

Fixes: d5879267aa ("isisd: fix show database json format")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
10 months agoisisd: fix neighbor id json key
Louis Scalbert [Fri, 21 Jun 2024 09:18:59 +0000 (11:18 +0200)]
isisd: fix neighbor id json key

d5879267aa ("isisd: fix show database json format") renamed JSON keys to
a standard format but forgot to rename the neighbor-id key.

Fixes: d5879267aa ("isisd: fix show database json format")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
10 months agoisisd: remane flags_json variable
Louis Scalbert [Fri, 21 Jun 2024 09:17:32 +0000 (11:17 +0200)]
isisd: remane flags_json variable

The variable flags_json was incorrectly named, leading to confusion and
causing the bug fixed in the previous commit.

Rename the variable to refer to SRv6 End SID instead. Cosmetic change.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
10 months agoMerge pull request #16128 from LabNConsulting/aceelindem/ospf-ls-retrans-improve
Russ White [Mon, 24 Jun 2024 11:17:27 +0000 (07:17 -0400)]
Merge pull request #16128 from LabNConsulting/aceelindem/ospf-ls-retrans-improve

ospfd: Improve OSPF neighbor retransmission list granularity and pacing

10 months agozebra: Fix NULL pointer dereference 16270/head
Carmine Scarpitta [Fri, 21 Jun 2024 15:47:46 +0000 (17:47 +0200)]
zebra: Fix NULL pointer dereference

The `locator` pointer is dereferenced before ensuring it is not NULL.
Fix the issue by checking that the pointer is not NULL before
dereferencing it.

Fixes 1594013

** CID 1594013:  Null pointer dereferences  (REVERSE_INULL)
/zebra/zebra_srv6.c: 961 in zebra_srv6_sid_compose()

________________________________________________________________________________________________________
*** CID 1594013:  Null pointer dereferences  (REVERSE_INULL)
/zebra/zebra_srv6.c: 961 in zebra_srv6_sid_compose()
955         struct srv6_locator *locator,
956         uint32_t sid_func)
957     {
958      uint8_t offset, func_len;
959      struct srv6_sid_format *format = locator->sid_format;
960
     CID 1594013:  Null pointer dereferences  (REVERSE_INULL)
     Null-checking "locator" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
961      if (!sid_value || !locator)
962      return false;
963
964      if (format) {
965      offset = format->block_len + format->node_len;
966      func_len = format->function_len;

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
10 months agozebra: Fix wrong variable used in `for` loop
Carmine Scarpitta [Fri, 21 Jun 2024 15:41:34 +0000 (17:41 +0200)]
zebra: Fix wrong variable used in `for` loop

The `for` loop starting at line 1848 searches the `func_allocated` array
for a pointer that points to a specific `sid_wide_func` element.

The loop should iterate over all the elements of the `func_allocated`
array and dereference each element to see if it is the one we are
looking for.

Currently, the loop is using the wrong variable to iterate over the
array.

Let's fix this issue by using the correct variable in the loop.

Fixes CID 1594014
Fixes CID 1594016

** CID 1594014:  Null pointer dereferences  (FORWARD_NULL)
/zebra/zebra_srv6.c: 1860 in release_srv6_sid_func_explicit()

________________________________________________________________________________________________________
*** CID 1594014:  Null pointer dereferences  (FORWARD_NULL)
/zebra/zebra_srv6.c: 1860 in release_srv6_sid_func_explicit()
1854
1855      /* Lookup SID function in the functions allocated list of EWLIB range */
1856      for (ALL_LIST_ELEMENTS_RO(block->u.usid
1857        .wide_lib[sid_func]
1858        .func_allocated,
1859        node, sid_func_ptr))
     CID 1594014:  Null pointer dereferences  (FORWARD_NULL)
     Dereferencing null pointer "sid_wide_func_ptr".
1860      if (*sid_wide_func_ptr == sid_wide_func)
1861      break;
1862
1863      /* Ensure that the SID function is allocated */
1864      if (!sid_wide_func_ptr) {
1865      zlog_warn("%s: failed to release wide SID function %u, function is not allocated",

** CID 1594016:  Possible Control flow issues  (DEADCODE)
/zebra/zebra_srv6.c: 1871 in release_srv6_sid_func_explicit()

________________________________________________________________________________________________________
*** CID 1594016:  Possible Control flow issues  (DEADCODE)
/zebra/zebra_srv6.c: 1871 in release_srv6_sid_func_explicit()
1865      zlog_warn("%s: failed to release wide SID function %u, function is not allocated",
1866        __func__, sid_wide_func);
1867      return -1;
1868      }
1869
1870      /* Release the SID function from the EWLIB range */
     CID 1594016:  Possible Control flow issues  (DEADCODE)
     Execution cannot reach this statement: "listnode_delete(block->u.us...".
1871      listnode_delete(block->u.usid.wide_lib[sid_func]
1872      .func_allocated,
1873      sid_wide_func_ptr);
1874      zebra_srv6_sid_func_free(sid_wide_func_ptr);
1875      } else {
1876      zlog_warn("%s: function %u is outside ELIB [%u/%u] and EWLIB alloc ranges [%u/%u]",

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
10 months agozebra: Remove dead SRv6 code
Carmine Scarpitta [Fri, 21 Jun 2024 15:01:49 +0000 (17:01 +0200)]
zebra: Remove dead SRv6 code

At line 1736, `alloc_mode` is set to `SRV6_SID_ALLOC_MODE_EXPLICIT` or
`SRV6_SID_ALLOC_MODE_DYNAMIC` depending on the `sid_value` variable.

There will never be a case where alloc_mode will be `SRV6_SID_ALLOC_MODE_MAX`
or `SRV6_SID_ALLOC_MODE_UNSPEC`.

Let's replace the `switch(alloc_mode) {...}` with an if-else.

Fixes CID 1594015.

** CID 1594015:    (DEADCODE)
/zebra/zebra_srv6.c: 1782 in get_srv6_sid()
/zebra/zebra_srv6.c: 1781 in get_srv6_sid()

________________________________________________________________________________________________________
*** CID 1594015:    (DEADCODE)
/zebra/zebra_srv6.c: 1782 in get_srv6_sid()
1776      }
1777
1778      ret = get_srv6_sid_dynamic(sid, ctx, locator);
1779
1780      break;
1781      case SRV6_SID_ALLOC_MODE_MAX:
     CID 1594015:    (DEADCODE)
     Execution cannot reach this statement: "case SRV6_SID_ALLOC_MODE_UN...".
1782      case SRV6_SID_ALLOC_MODE_UNSPEC:
1783      default:
1784      flog_err(EC_ZEBRA_SM_CANNOT_ASSIGN_SID,
1785       "%s: SRv6 Manager: Unrecognized alloc mode %u",
1786       __func__, alloc_mode);
1787      /* We should never arrive here */
/zebra/zebra_srv6.c: 1781 in get_srv6_sid()
1775      return -1;
1776      }
1777
1778      ret = get_srv6_sid_dynamic(sid, ctx, locator);
1779
1780      break;
     CID 1594015:    (DEADCODE)
     Execution cannot reach this statement: "case SRV6_SID_ALLOC_MODE_MAX:".
1781      case SRV6_SID_ALLOC_MODE_MAX:
1782      case SRV6_SID_ALLOC_MODE_UNSPEC:
1783      default:
1784      flog_err(EC_ZEBRA_SM_CANNOT_ASSIGN_SID,
1785       "%s: SRv6 Manager: Unrecognized alloc mode %u",
1786       __func__, alloc_mode);

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
10 months agoisisd: fix display crash srv6 sid structure in json
Louis Scalbert [Fri, 21 Jun 2024 08:59:43 +0000 (10:59 +0200)]
isisd: fix display crash srv6 sid structure in json

Fix a crash when doing "show isis database detail json" in
isis_srv6_topo1 topotest.

> #0  raise (sig=<optimized out>) at ../sysdeps/unix/sysv/linux/raise.c:50
> #1  0x00007fad89524e2c in core_handler (signo=6, siginfo=0x7ffe86a4b8b0, context=0x7ffe86a4b780) at lib/sigevent.c:258
> #2  <signal handler called>
> #3  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
> #4  0x00007fad8904e537 in __GI_abort () at abort.c:79
> #5  0x00007fad8904e40f in __assert_fail_base (fmt=0x7fad891c5688 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x7fad8a3e70e8 "json_object_get_type(jso) == json_type_object",
>     file=0x7fad8a3e7064 "./json_object.c", line=590, function=<optimized out>) at assert.c:92
> #6  0x00007fad8905d662 in __GI___assert_fail (assertion=0x7fad8a3e70e8 "json_object_get_type(jso) == json_type_object", file=0x7fad8a3e7064 "./json_object.c", line=590,
>     function=0x7fad8a3e7440 "json_object_object_add_ex") at assert.c:101
> #7  0x00007fad8a3dfe93 in json_object_object_add_ex () from /lib/x86_64-linux-gnu/libjson-c.so.5
> #8  0x000055708e3f8f7f in format_subsubtlv_srv6_sid_structure (sid_struct=0x602000172b70, buf=0x0, json=0x6040000a21d0, indent=6) at isisd/isis_tlvs.c:2880
> #9  0x000055708e3f9acb in isis_format_subsubtlvs (subsubtlvs=0x602000172b50, buf=0x0, json=0x6040000a21d0, indent=6) at isisd/isis_tlvs.c:3022
> #10 0x000055708e3eefb0 in format_item_ext_subtlvs (exts=0x614000047440, buf=0x0, json=0x6040000a2190, indent=2, mtid=2) at isisd/isis_tlvs.c:1313
> #11 0x000055708e3fd599 in format_item_extended_reach (mtid=2, i=0x60300015aed0, buf=0x0, json=0x6040000a1bd0, indent=0) at isisd/isis_tlvs.c:3763
> #12 0x000055708e40d46a in format_item (mtid=2, context=ISIS_CONTEXT_LSP, type=ISIS_TLV_MT_REACH, i=0x60300015aed0, buf=0x0, json=0x6040000a1bd0, indent=0) at isisd/isis_tlvs.c:6789
> #13 0x000055708e40d4fc in format_items_ (mtid=2, context=ISIS_CONTEXT_LSP, type=ISIS_TLV_MT_REACH, items=0x60600021d160, buf=0x0, json=0x6040000a1bd0, indent=0) at isisd/isis_tlvs.c:6804
> #14 0x000055708e40edbc in format_mt_items (context=ISIS_CONTEXT_LSP, type=ISIS_TLV_MT_REACH, m=0x6180000845d8, buf=0x0, json=0x6040000a1bd0, indent=0) at isisd/isis_tlvs.c:7147
> #15 0x000055708e4111e9 in format_tlvs (tlvs=0x618000084480, buf=0x0, json=0x6040000a1bd0, indent=0) at isisd/isis_tlvs.c:7572
> #16 0x000055708e4114ce in isis_format_tlvs (tlvs=0x618000084480, json=0x6040000a1bd0) at isisd/isis_tlvs.c:7613
> #17 0x000055708e36f167 in lsp_print_detail (lsp=0x612000058b40, vty=0x0, json=0x6040000a1bd0, dynhost=1 '\001', isis=0x60d00001f800) at isisd/isis_lsp.c:785
> #18 0x000055708e36f31f in lsp_print_all (vty=0x0, json=0x6040000a0490, head=0x61f000005488, detail=1 '\001', dynhost=1 '\001', isis=0x60d00001f800) at isisd/isis_lsp.c:820
> #19 0x000055708e4379fc in show_isis_database_lspdb_json (json=0x6040000a0450, area=0x61f000005480, level=0, lspdb=0x61f000005488, sysid_str=0x0, ui_level=1) at isisd/isisd.c:2683
> #20 0x000055708e437ef9 in show_isis_database_json (json=0x6040000a0310, sysid_str=0x0, ui_level=1, isis=0x60d00001f800) at isisd/isisd.c:2754
> #21 0x000055708e438357 in show_isis_database_common (vty=0x62e000060400, json=0x6040000a0310, sysid_str=0x0, ui_level=1, isis=0x60d00001f800) at isisd/isisd.c:2788
> #22 0x000055708e438591 in show_isis_database (vty=0x62e000060400, json=0x6040000a0310, sysid_str=0x0, ui_level=1, vrf_name=0x7fad89806300 <vrf_default_name> "default", all_vrf=false)
>     at isisd/isisd.c:2825
> #23 0x000055708e43891d in show_database (self=0x55708e5519c0 <show_database_cmd>, vty=0x62e000060400, argc=5, argv=0x6040000a02d0) at isisd/isisd.c:2855
> #24 0x00007fad893a9767 in cmd_execute_command_real (vline=0x60300015f220, vty=0x62e000060400, cmd=0x0, up_level=0) at lib/command.c:1002
> #25 0x00007fad893a9adc in cmd_execute_command (vline=0x60300015f220, vty=0x62e000060400, cmd=0x0, vtysh=0) at lib/command.c:1061
> #26 0x00007fad893aa728 in cmd_execute (vty=0x62e000060400, cmd=0x621000025900 "show isis database detail json ", matched=0x0, vtysh=0) at lib/command.c:1227

Note that prior to 2e670cd779, there was no crash but only the last
"srv6-sid-structure" was displayed. A "srv6-sid-structure" should be
displayed for each "sid". This commit also fix this.

Was:

> "srv6-lan-endx-sid": [
>   {
>     "sid": "fc00:0:1:1::",
>     "weight": 0,
>     "algorithm": "SPF",
>     "neighbor-id": "0000.0000.0002"
>   },
>   {
>     "sid": "fc00:0:1:2::",
>     "weight": 0,
>     "algorithm": "SPF",
>     "neighbor-id": "0000.0000.0003"
>   }
> ],
> "srv6-sid-structure": {
>   "loc-block-len": 32,
>   "loc-node-len": 16,
>   "func-len": 16,
>   "arg-len": 0
> },

Now (srv6-sid-structure are identical but they are not always):

> "srv6-lan-endx-sid": [
>   {
>     "sid": "fc00:0:1:1::",
>     "algorithm": "SPF",
>     "neighbor-id": "0000.0000.0002",
>     "srv6-sid-structure": {
>       "loc-block-len": 32,
>       "loc-node-len": 16,
>       "func-len": 8,
>       "arg-len": 0
>     },
>   },
>   {
>     "sid": "fc00:0:1:2::",
>     "algorithm": "SPF",
>     "neighbor-id": "0000.0000.0003",
>     "srv6-sid-structure": {
>       "loc-block-len": 32,
>       "loc-node-len": 16,
>       "func-len": 16,
>       "arg-len": 0
>     },
>   }
> ],

Fixes: 2e670cd779 ("isisd: fix display of srv6 subsubtlvs")
Fixes: 648a158802 ("isisd: Add SRv6 End.X SID to Sub-TLV format func")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
10 months agoisisd: change the json output for isis routes 16182/head
Philippe Guibert [Wed, 19 Jun 2024 14:10:48 +0000 (16:10 +0200)]
isisd: change the json output for isis routes

The json format for json routes should be compliant with caml format.

Before:

> "Prefix|Metric|Interface|Nexthop|SID|LabelOp|Algo":
> "Prefix|Metric|Interface|Nexthop|Label(s)");

After:

> "prefix|metric|interface|nextHop|segmentIdentifier|labelOperation|Algorithm":
> "prefix|metric|interface|nextHop|label(s)");

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
10 months agoisisd: override json fields for monitored paths
Philippe Guibert [Wed, 19 Jun 2024 14:05:33 +0000 (16:05 +0200)]
isisd: override json fields for monitored paths

The json output for isis route paths should use caml format.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
10 months agotopotests: isis_topo1_vrf, align json support on 'show isis topology' command
Philippe Guibert [Fri, 14 Jun 2024 14:22:56 +0000 (16:22 +0200)]
topotests: isis_topo1_vrf, align json support on 'show isis topology' command

Add the json support from ISIS vty command.
> show isis vrf vrf1 topology json

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
10 months agotopotests: isis_topo1, use 'show isis topology json' command
Philippe Guibert [Fri, 14 Jun 2024 08:18:15 +0000 (10:18 +0200)]
topotests: isis_topo1, use 'show isis topology json' command

Add the json support from ISIS vty command.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
10 months agoisisd: add json support for 'show isis topology' command
Philippe Guibert [Fri, 14 Jun 2024 06:57:16 +0000 (08:57 +0200)]
isisd: add json support for 'show isis topology' command

Add the json keyword for dumping isis topology.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
10 months agoisisd: add json support to display spf paths in 'show isis route'
Philippe Guibert [Thu, 6 Jun 2024 15:08:56 +0000 (17:08 +0200)]
isisd: add json support to display spf paths in 'show isis route'

The 'show isis route json' command never displays the list of
paths. Add the json support for this sub-part.

> # show isis route json
> [..]
> "ipv6-paths":[
>  {
>   "Vertex":"rt1",
>   "Type":"",
>   "Metric":0,
>   "Next-Hop":"",
>   "Interface":"",
>   "Parent":""
>  },
>  {
>    "Vertex":"2001:db8:1000::1\/128",
>    "Type":"IP6 internal",
>    "Metric":0,
>    "Next-Hop":"",
>    "Interface":"",
>    "Parent":"rt1(4)"
>  },

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
10 months agoisisd: show isis route uses ttable for paths
Philippe Guibert [Thu, 6 Jun 2024 16:03:24 +0000 (18:03 +0200)]
isisd: show isis route uses ttable for paths

This is a preliminary commit, so that route paths are visible from json.

Before:
> IS-IS paths to level-1 routers that speak IPv6
> Vertex               Type         Metric Next-Hop             Interface Parent
> rt1
> 2001:db8:1000::1/128 IP6 internal 0                                     rt1(4)
> rt2                  TE-IS        10     rt2                  eth-rt2   rt1(4)
> rt3                  TE-IS        10     rt3                  eth-rt3   rt1(4)
> 2001:db8:1000::2/128 IP6 internal 20     rt2                  eth-rt2   rt2(4)
> 2001:db8:1000::3/128 IP6 internal 20     rt3                  eth-rt3   rt3(4)

After:
> Vertex                Type          Metric  Next-Hop  Interface  Parent
>  -------------------------------------------------------------------------
>  rt1
>  2001:db8:1000::1/128  IP6 internal  0                            rt1(4)
>  rt2                   TE-IS         10      rt2       eth-rt2    rt1(4)
>  rt3                   TE-IS         10      rt3       eth-rt3    rt1(4)
>  2001:db8:1000::2/128  IP6 internal  20      rt2       eth-rt2    rt2(4)
>  2001:db8:1000::3/128  IP6 internal  20      rt3       eth-rt3    rt3(4)

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
10 months agotools/checkpatch: accept pim_* typedefs 16259/head
David Lamparter [Fri, 21 Jun 2024 09:32:05 +0000 (11:32 +0200)]
tools/checkpatch: accept pim_* typedefs

pimd uses "v4/v6 dispatch" typedefs.  Don't complain about those in
checkpatch.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
10 months agoMerge pull request #16252 from chiragshah6/evpn_dev1
Donatas Abraitis [Fri, 21 Jun 2024 06:46:07 +0000 (09:46 +0300)]
Merge pull request #16252 from chiragshah6/evpn_dev1

zebra: fix evpn mh bond member proto reinstall

10 months agoMerge pull request #16260 from pguibert6WIND/no_backup_nexthop_for_now
Donatas Abraitis [Fri, 21 Jun 2024 06:43:40 +0000 (09:43 +0300)]
Merge pull request #16260 from pguibert6WIND/no_backup_nexthop_for_now

bgpd: fix do not use api.backup_nexthop in ZAPI message

10 months agozebra: clear evpn dup-addr return error-msg when there is no vni 16261/head
Sindhu Parvathi Gopinathan [Wed, 19 Jun 2024 14:35:31 +0000 (07:35 -0700)]
zebra: clear evpn dup-addr return error-msg when there is no vni

clear evpn dup-addr cli returns error-msg for below conditions,

 - If evpn is not enabled &
 - If there is no VNI exists.

supported command:

```
clear evpn dup-addr vni <vni-id>
```

Ticket: #3495573

Testing:

bharat# clear evpn dup-addr vni all
Error type: validation
Error description: % EVPN not enabled

bharat# clear evpn dup-addr vni 20
Error type: validation
Error description: % VNI 20 does not exist

Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
Signed-off-by: Chirag Shah <chirag@nvidia.com>
10 months agobgpd: fix do not use api.backup_nexthop in ZAPI message 16260/head
Philippe Guibert [Thu, 20 Jun 2024 16:02:26 +0000 (18:02 +0200)]
bgpd: fix do not use api.backup_nexthop in ZAPI message

The backup_nexthop entry list has been populated by mistake,
and should not. Fix this by reverting the introduced behavior.

Fixes: 237ebf8d4503 ("bgpd: rework bgp_zebra_announce() function, separate nexthop handling")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
10 months agozebra: fix evpn mh bond member proto reinstall 16252/head
Chirag Shah [Wed, 19 Jun 2024 00:21:49 +0000 (17:21 -0700)]
zebra: fix evpn mh bond member proto reinstall

In case of EVPN MH bond, a member port going in
protodown state due to external reason (one case being linkflap),
frr updates the state correctly but upon manually
clearing external reason trigger FRR to reinstate
protodown without any reason code.

Fix is to ensure if the protodown reason was external
and new state is to have protodown 'off' then do no reinstate
protodown.

Ticket: #3947432
Testing:
switch:#ip link show swp1
4: swp1: <NO-CARRIER,BROADCAST,MULTICAST,SLAVE,UP> mtu 9216 qdisc
   pfifo_fast master bond1 state DOWN mode DEFAULT group default qlen
   1000
       link/ether 1c:34:da:2c:aa:68 brd ff:ff:ff:ff:ff:ff protodown on
       protodown_reason <linkflap>

switch:#ip link set swp1 protodown off protodown_reason linkflap off
switch:#ip link show swp1
 4: swp1: <NO-CARRIER,BROADCAST,MULTICAST,SLAVE,UP> mtu 9216 qdisc
    pfifo_fast master bond1 state DOWN mode DEFAULT group default qlen
    1000
        link/ether 1c:34:da:2c:aa:68 brd ff:ff:ff:ff:ff:ff

Signed-off-by: Chirag Shah <chirag@nvidia.com>
10 months agoospfd: Improve OSPF neighbor retransmission list granularity and precision 16128/head
Acee Lindem [Fri, 31 May 2024 14:08:04 +0000 (14:08 +0000)]
ospfd: Improve OSPF neighbor retransmission list granularity and precision

The current OSPF neighbor retransmission operates on a single per-neighbor
periodic timer that sends all LSAs on the list when it expires.
Additionally, since it skips the first retransmission of received LSAs so
that at least the retransmission interval (resulting in a delay of between
the retransmission interval and twice the interval. In environments where
the links are lossy on P2MP networks with "delay-reflood" configured (which
relies on neighbor retransmission in partial meshs), the implementation
is sub-optimal (to say the least).

This commit reimplements OSPF neighbor retransmission as follows:

   1. A new data structure making use the application managed
      typesafe.h doubly linked list implements an OSPF LSA
      list where each node includes a timestamp.
   2. The existing neighbor LS retransmission LSDB data structure
      is augmented with a pointer to the list node on the LSA
      list to faciliate O(1) removal when the LSA is acknowledged.
   3. The neighbor LS retransmission timer is set to the expiration
      timer of the LSA at the top of the list.
   4. When the timer expires, LSAs are retransmitted that within
      the window of the current time and a small delta (50 milli-secs
      default). The LSAs that are retransmited are given an updated
      retransmission time and moved to the end of the LSA list.
   5. Configuration is added to set the "retransmission-window" to a
      value other than 50 milliseconds.
   6. Neighbor and interface LSA retransmission counters are added
      to provide insight into the lossiness of the links. However,
      these will increment quickly on non-fully meshed P2MP networks
      with "delay-reflood" configured.
   7. Added a topotest to exercise the implementation on a non-fully
      meshed P2MP network with "delay-reflood" configured. The
      alternative was to use existing mechanisms to instroduce loss
      but these seem less determistic in a topotest.

Signed-off-by: Acee Lindem <acee@lindem.com>
10 months agopimd: prepare NHT for tracking BSM C-RPs
David Lamparter [Fri, 25 Jun 2021 09:42:38 +0000 (11:42 +0200)]
pimd: prepare NHT for tracking BSM C-RPs

For BSMs, we should track which of the RP candidates in the BSM message
are actually available, before trying to use them (which also puts them
in NHT for that).  This applies for both BSRs as well as BSM receivers.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
10 months agopimd: allow sending packets without pinned iface
David Lamparter [Sat, 9 Jul 2022 16:47:43 +0000 (18:47 +0200)]
pimd: allow sending packets without pinned iface

The upcoming Candidate-RP code needs to send PIM packets that go through
normal unicast routing, without forcing a specific output interface.
Allow passing in NULL ifp to do that.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
10 months agopimd: add prefix_* and IANA_AFI v4/v6 defines
David Lamparter [Wed, 8 May 2024 17:25:55 +0000 (19:25 +0200)]
pimd: add prefix_* and IANA_AFI v4/v6 defines

The Candidate-RP code is about to use these.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
10 months agopimd: add debugs for i-am-RP state
David Lamparter [Mon, 11 Jul 2022 19:58:27 +0000 (21:58 +0200)]
pimd: add debugs for i-am-RP state

This proved helpful in debugging the Candidate-RP code.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
10 months agopimd: make clang-format slightly less annoying
David Lamparter [Wed, 8 May 2024 17:27:22 +0000 (19:27 +0200)]
pimd: make clang-format slightly less annoying

The YANG module list is really better as 1-item-per-line.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
10 months agoredhat: Add option to build pkg with grpc support 16094/head
Martin Winter [Wed, 29 May 2024 17:13:19 +0000 (19:13 +0200)]
redhat: Add option to build pkg with grpc support

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
10 months agodebian: Add option to build pkg with grpc support
Martin Winter [Wed, 15 May 2024 08:32:33 +0000 (10:32 +0200)]
debian: Add option to build pkg with grpc support

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
10 months agoMerge pull request #16059 from kacpekwasny/kkwasny/CLIC-139-4
Donatas Abraitis [Thu, 20 Jun 2024 07:51:06 +0000 (10:51 +0300)]
Merge pull request #16059 from kacpekwasny/kkwasny/CLIC-139-4

bgpd: fixed failing to remove VRF if there is a stale l3vni

10 months agoMerge pull request #16243 from donaldsharp/ubsan_documentation
Donatas Abraitis [Thu, 20 Jun 2024 05:08:30 +0000 (08:08 +0300)]
Merge pull request #16243 from donaldsharp/ubsan_documentation

doc: Document the usage of --enable-undefined-sanitizer

10 months agoMerge pull request #16234 from chiragshah6/fdev2
Donatas Abraitis [Thu, 20 Jun 2024 05:03:42 +0000 (08:03 +0300)]
Merge pull request #16234 from chiragshah6/fdev2

bgpd: backpressure - fix evpn route sync to zebra

10 months agodoc: Document the usage of --enable-undefined-sanitizer 16243/head
Donald Sharp [Wed, 19 Jun 2024 12:01:16 +0000 (08:01 -0400)]
doc: Document the usage of --enable-undefined-sanitizer

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
10 months agobgpd: Remove redundant whitespace before printing the reason of the failed peer 16242/head
Donatas Abraitis [Wed, 19 Jun 2024 11:32:16 +0000 (14:32 +0300)]
bgpd: Remove redundant whitespace before printing the reason of the failed peer

Before:

```
Neighbor        EstdCnt DropCnt ResetTime Reason
127.0.0.1             0       0     never  Waiting for peer OPEN (n/a)
```

After:

```
Neighbor        EstdCnt DropCnt ResetTime Reason
127.0.0.1             0       0     never Waiting for peer OPEN (n/a)
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
10 months agobgpd: Set last reset reason to admin shutdown if it was manually
Donatas Abraitis [Wed, 19 Jun 2024 11:09:00 +0000 (14:09 +0300)]
bgpd: Set last reset reason to admin shutdown if it was manually

Before this patch, we always printed the last reason "Waiting for OPEN", but
if it's a manual shutdown, then we technically are not waiting for OPEN.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
10 months agoMerge pull request #16224 from donaldsharp/zebra_dplane_event_loop_starvation
Donatas Abraitis [Wed, 19 Jun 2024 07:22:36 +0000 (10:22 +0300)]
Merge pull request #16224 from donaldsharp/zebra_dplane_event_loop_starvation

zebra: Prevent starvation in dplane_thread_loop

10 months agoMerge pull request #16223 from donaldsharp/bgp_vrf_name
Donatas Abraitis [Wed, 19 Jun 2024 07:22:16 +0000 (10:22 +0300)]
Merge pull request #16223 from donaldsharp/bgp_vrf_name

bgpd: Convert over to using vrf name instead of id

10 months agobgpd: backpressure - fix evpn route sync to zebra 16234/head
Chirag Shah [Mon, 17 Jun 2024 20:58:03 +0000 (13:58 -0700)]
bgpd: backpressure - fix evpn route sync to zebra

In scaled EVPN + ipv4/ipv6 uni route sync to zebra,
some of the ipv4/ipv6 routes skipped reinstallation
due to incorrect local variable's stale value.

Once the local variable value reset in each loop
iteration all skipped routes synced to zebra properly.

Ticket: #3948828

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
Signed-off-by: Chirag Shah <chirag@nvidia.com>
10 months agobgpd: Convert over to using vrf name instead of id 16223/head
Donald Sharp [Fri, 14 Jun 2024 15:32:06 +0000 (11:32 -0400)]
bgpd: Convert over to using vrf name instead of id

Use the name for when putting out debugs in bgp_zebra.c.
Additionally add an evpn flag for announce_route_actual.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
10 months agoMerge pull request #16227 from y-bharath14/srib-topotest-e
Donald Sharp [Tue, 18 Jun 2024 19:52:38 +0000 (15:52 -0400)]
Merge pull request #16227 from y-bharath14/srib-topotest-e

tests: Avoid importing unused modules

10 months agoMerge pull request #16237 from pguibert6WIND/json_ttable_caml_format
Donald Sharp [Tue, 18 Jun 2024 19:26:00 +0000 (15:26 -0400)]
Merge pull request #16237 from pguibert6WIND/json_ttable_caml_format

lib: add json API to dump and override row naming convention

10 months agoisisd: add locator name in sid notify messages 15677/head
Philippe Guibert [Sat, 8 Jun 2024 05:15:47 +0000 (07:15 +0200)]
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>
10 months agotests: Update IS-IS SRv6 topotests
Carmine Scarpitta [Thu, 6 Jun 2024 12:50:06 +0000 (14:50 +0200)]
tests: Update IS-IS SRv6 topotests

The locator is no longer split in multiple chunks.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
10 months agoisisd: Cleanup related to SRv6
Carmine Scarpitta [Sat, 23 Mar 2024 20:43:17 +0000 (21:43 +0100)]
isisd: Cleanup related to SRv6

Remove unused SRv6 code.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
10 months agoisisd: Receive SRv6 SIDs notifications from zebra
Carmine Scarpitta [Thu, 9 May 2024 09:51:16 +0000 (11:51 +0200)]
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>
10 months agoisisd: Release SRv6 SIDs to SID Manager
Carmine Scarpitta [Thu, 9 May 2024 11:03:45 +0000 (13:03 +0200)]
isisd: Release SRv6 SIDs to SID Manager

Currently, IS-IS allocates SIDs without interacting with Zebra.

Recently, the SRv6 implementation has been improved. Now, the daemons
need to interact with Zebra through ZAPI to obtain and release SIDs.

This commit extends IS-IS to release SIDs to Zebra when they are no
longer needed.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>