]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
18 months agoisisd: remove redundant northbound destroy callbacks 14541/head
Igor Ryzhov [Fri, 6 Oct 2023 14:33:35 +0000 (17:33 +0300)]
isisd: remove redundant northbound destroy callbacks

Fixes startup warnings:
```
ISIS: [ZKB8W-3S2Q4][EC 100663330] unneeded 'destroy' callback for '/frr-isisd:isis/instance/segment-routing-srv6/msd/node-msd/max-segs-left'
ISIS: [ZKB8W-3S2Q4][EC 100663330] unneeded 'destroy' callback for '/frr-isisd:isis/instance/segment-routing-srv6/msd/node-msd/max-end-pop'
ISIS: [ZKB8W-3S2Q4][EC 100663330] unneeded 'destroy' callback for '/frr-isisd:isis/instance/segment-routing-srv6/msd/node-msd/max-h-encaps'
ISIS: [ZKB8W-3S2Q4][EC 100663330] unneeded 'destroy' callback for '/frr-isisd:isis/instance/segment-routing-srv6/msd/node-msd/max-end-d'
```

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
18 months agoMerge pull request #14534 from mjstapp/fix_topo_nhgid
Donald Sharp [Thu, 5 Oct 2023 19:36:27 +0000 (15:36 -0400)]
Merge pull request #14534 from mjstapp/fix_topo_nhgid

tests: locate nhg id from json output in all_proto_startup

18 months agotests: locate nhg id from json output in all_proto_startup 14534/head
Mark Stapp [Thu, 5 Oct 2023 17:47:17 +0000 (13:47 -0400)]
tests: locate nhg id from json output in all_proto_startup

Don't hard-code a sharpd nhg id: those values aren't stable
if the daemons/protos/route-types change. Use json show output
to find the id in the 'resilient' nhg test case in
the all_protocol_startup suite.

Signed-off-by: Mark Stapp <mjs@labn.net>
18 months agoMerge pull request #14517 from adrianomarto/pim-msdp-sa-rp
Donald Sharp [Thu, 5 Oct 2023 14:27:06 +0000 (10:27 -0400)]
Merge pull request #14517 from adrianomarto/pim-msdp-sa-rp

pimd: Indicating the configured PIM Rendezvous Point (RP) in the MSDP SA message

18 months agoMerge pull request #14474 from donaldsharp/strsep_fixup
Rafael Zalamena [Thu, 5 Oct 2023 12:25:45 +0000 (09:25 -0300)]
Merge pull request #14474 from donaldsharp/strsep_fixup

staticd: Memory leak of string in staticd

18 months agostaticd: Memory leak of string in staticd 14474/head
Donald Sharp [Fri, 22 Sep 2023 17:13:38 +0000 (13:13 -0400)]
staticd: Memory leak of string in staticd

XSTRDUP and then calling strsep mangles the
pointer returned by XSTRDUP.  Keep a copy
of the orig and when we are done, free that instead.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
18 months agoMerge pull request #14527 from opensourcerouting/fix/guard_debug_messages_for_ttl
Donald Sharp [Wed, 4 Oct 2023 11:33:12 +0000 (07:33 -0400)]
Merge pull request #14527 from opensourcerouting/fix/guard_debug_messages_for_ttl

bgpd: Add guards for zlog_debug when setting GTSM for the peer

18 months agopimd: Indicating the rp in the msdp sa message 14517/head
Adriano Marto Reis [Sat, 30 Sep 2023 05:49:40 +0000 (15:49 +1000)]
pimd: Indicating the rp in the msdp sa message

Indicating the configured PIM Rendezvous Point (RP) in the MSDP SA
message

The RFC-3618, section 12.2.1, describes the fields included in the MSDP
SA message. The "RP address" field is "the address of the RP in the
domain the source has become active in".

In the most common case, we will establish an MSDP connection from RP to
RP. However, there are cases where we want to establish a MSDP
connection from an interface/address that is not the RP. Section 3 of
RFC-3618 describes that scenario as "intermediate MSDP peer". Moreover,
the RP could be another router in the PIM domain - not the one
establishing the MSDP connection.

The current implementation could be problematic even with a single
router per PIM domain. Consider the following scenario:
* There are two PIM domains, each one with a single router.
* The two routers are connected via two independent networks. Let's say
that is to provide redundancy.
* The routers are configured to establish two MSDP connections, one on
each network (redundancy again).
* A multicast source becomes active on the router 1. It will be
communicated to router 2 via two independent MSDP SA messages, one per
MSDP connection.
* Without these changes, each MSDP SA message will indicate a different
RP.
* Both RP addresses will pass the RPF check, and both MSDP sources will
be accepted.
* If the router has clients interested in that multicast group, it will
send PIM Join messages to both RPs and start receiving the multicast
traffic from both.

With the changes included in this commit, the multicast source available
in router 1 would still be communicated to router 2 twice. But both MSDP
SA messages would indicate the same RP, and one of them would be
discarded due to failure in the RPF-check failure. Also, the changes
allow us to define the RP that will be included in the MSDP SA message,
and it could be one of the interfaces used to establish the MSDP
connection, some other interface on the router, a loopback interface, or
another router in the PIM domain.

These changes should not create compatibility issues. As I mentioned, we
usually establish MSDP connections from RP to RP. In this case, the
result will be the same. We would still indicate the address used to
establish the MSDP connection if the RP is not set - I wonder if that
should even be a valid configuration.

Signed-off-by: Adriano Marto Reis <adrianomarto@gmail.com>
18 months agobgpd: Add guards for zlog_debug when setting GTSM for the peer 14527/head
Donatas Abraitis [Tue, 3 Oct 2023 14:46:24 +0000 (17:46 +0300)]
bgpd: Add guards for zlog_debug when setting GTSM for the peer

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agoMerge pull request #14511 from opensourcerouting/fix/bgpd_software_version_capability
Russ White [Tue, 3 Oct 2023 14:36:21 +0000 (10:36 -0400)]
Merge pull request #14511 from opensourcerouting/fix/bgpd_software_version_capability

bgpd: Validate maximum length of software version when handling via dynamic caps

18 months agoMerge pull request #14472 from opensourcerouting/plist-dup
Russ White [Tue, 3 Oct 2023 14:28:52 +0000 (10:28 -0400)]
Merge pull request #14472 from opensourcerouting/plist-dup

lib: fix route map duplicated prefix removal evaluation

18 months agoMerge pull request #13814 from pguibert6WIND/comm_list_expanded_match_no_exact
Russ White [Tue, 3 Oct 2023 12:55:30 +0000 (08:55 -0400)]
Merge pull request #13814 from pguibert6WIND/comm_list_expanded_match_no_exact

bgpd: add match community "any" to match any incoming community

18 months agoMerge pull request #14508 from LabNConsulting/chopps/darr-use-frrmemfunc
Donatas Abraitis [Tue, 3 Oct 2023 07:34:27 +0000 (10:34 +0300)]
Merge pull request #14508 from LabNConsulting/chopps/darr-use-frrmemfunc

lib: use XREALLOC over realloc avoid coverity warning

18 months agoMerge pull request #14519 from anlancs/fix/doc-zebra-values
Donald Sharp [Mon, 2 Oct 2023 20:55:22 +0000 (16:55 -0400)]
Merge pull request #14519 from anlancs/fix/doc-zebra-values

18 months agotopotests: add bgp_large_comm_list_match test 13814/head
Philippe Guibert [Mon, 10 Jul 2023 14:41:38 +0000 (16:41 +0200)]
topotests: add bgp_large_comm_list_match test

Add a topotest to check for proper functioning of the
bgp large community list match operation under a route-map.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
18 months agobgpd: add 'match community-list any' function
Philippe Guibert [Tue, 27 Jun 2023 19:36:01 +0000 (21:36 +0200)]
bgpd: add 'match community-list any' function

There is no match mechanism to match one community from the
incoming community-list. Add the 'any' keyword to the 'match
route-map' command of communit-list and large-community-list.

> match community-list AAA any
> match large-community-list AAA any

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
18 months agodoc: adjust protocol command values for zebra 14519/head
anlan_cs [Sun, 1 Oct 2023 06:46:28 +0000 (14:46 +0800)]
doc: adjust protocol command values for zebra

Adjust protocol command values for zebra based on latest code.
Also, expand the field width to fit the length.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
19 months agoMerge pull request #14510 from opensourcerouting/fix/coccinelle_issues
Donald Sharp [Fri, 29 Sep 2023 13:27:44 +0000 (09:27 -0400)]
Merge pull request #14510 from opensourcerouting/fix/coccinelle_issues

A couple minor fixes

19 months agoMerge pull request #12409 from FRIDM636/master
Donatas Abraitis [Fri, 29 Sep 2023 09:54:43 +0000 (12:54 +0300)]
Merge pull request #12409 from FRIDM636/master

zebra: delete label chunk upon release

19 months agotests: Make sure we have a valid FRRouting software version string 14511/head
Donatas Abraitis [Fri, 29 Sep 2023 09:15:24 +0000 (12:15 +0300)]
tests: Make sure we have a valid FRRouting software version string

It can't begin with anything else, otherwise something is broken on the wire.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobgpd: Validate maximum length of software version when handling via dynamic caps
Donatas Abraitis [Fri, 29 Sep 2023 09:13:43 +0000 (12:13 +0300)]
bgpd: Validate maximum length of software version when handling via dynamic caps

We should not allow exceeding the stream's length, and also software version
can't be larger than 64 bytes.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months ago*: Do not cast to the same type as the destination is 14510/head
Donatas Abraitis [Fri, 29 Sep 2023 06:17:56 +0000 (09:17 +0300)]
*: Do not cast to the same type as the destination is

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agozebra: delete label chunk upon release 12409/head
fmihoub6WIND [Fri, 25 Nov 2022 10:17:07 +0000 (11:17 +0100)]
zebra: delete label chunk upon release

In zebra/label_manager.c the releasing of the label chunk is done by
disowning the chunk to the system. The presence of this system label
chunk will cause label assignment to fail for this use case example:

label chunk ospf: 300-320
label chunk system: 510-520
label chunk isis: 1200-1300

Then we try to allocate the chunk 500-530, we get this error:
  "Allocation of mpls label chunk [500/530] failed"

The error is raised when the below condition is true:
    /* if chunk is used, cannot honor request */
      if (lmc->proto != NO_PROTO)
      return NULL;

Delete the label chunk instead of disowning it when the label releasing
is done.

Signed-off-by: Farid MIHOUB <farid.mihoub@6wind.com>
19 months agozebra: dump label table information
fmihoub6WIND [Fri, 2 Dec 2022 10:10:19 +0000 (11:10 +0100)]
zebra: dump label table information

Add the new command "show debugging labeltable" to show allocated label
chunks in the label table managed with label_manager.c

Signed-off-by: Farid Mihoub <farid.mihoub@6wind.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
19 months agozebra: Drop new lines from zlog_debug for dpdk debug messages
Donatas Abraitis [Fri, 29 Sep 2023 06:02:58 +0000 (09:02 +0300)]
zebra: Drop new lines from zlog_debug for dpdk debug messages

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agoMerge pull request #14507 from qlyoung/fix-doc-more-doc-more
Donatas Abraitis [Fri, 29 Sep 2023 05:41:41 +0000 (08:41 +0300)]
Merge pull request #14507 from qlyoung/fix-doc-more-doc-more

More developer doc fixes

19 months agoMerge pull request #14506 from louis-6wind/fix-bgp-link-state
Donatas Abraitis [Fri, 29 Sep 2023 05:29:31 +0000 (08:29 +0300)]
Merge pull request #14506 from louis-6wind/fix-bgp-link-state

bgpd: fix link state coverity scan issues

19 months agolib: use XREALLOC over realloc avoid coverity warning 14508/head
Christian Hopps [Thu, 28 Sep 2023 16:10:31 +0000 (12:10 -0400)]
lib: use XREALLOC over realloc avoid coverity warning

I believe coverity is complaining that the current code does not handle the
realloc fail case, in which case the original pointer is not freed, but NULL is
returned. The code assert()s it's not failed but that is not strong enough it
needs to abort which XREALLOC does and is a better integration into FRR-inrfa
anyway.

Signed-off-by: Christian Hopps <chopps@labn.net>
19 months agoMerge pull request #14505 from qlyoung/fix-rtd-build-sphinx-version
mobash-rasool [Fri, 29 Sep 2023 04:14:39 +0000 (09:44 +0530)]
Merge pull request #14505 from qlyoung/fix-rtd-build-sphinx-version

doc: unpin sphinx from 4.0.2

19 months agoMerge pull request #14503 from opensourcerouting/fix/add_bgp_neighbor_capability_dynamic
Donald Sharp [Thu, 28 Sep 2023 19:50:55 +0000 (15:50 -0400)]
Merge pull request #14503 from opensourcerouting/fix/add_bgp_neighbor_capability_dynamic

doc: Add `neighbor capability dynamic` command

19 months agoMerge pull request #14483 from opensourcerouting/fix/ignore_setting_ttl_for_negative_...
Donald Sharp [Thu, 28 Sep 2023 19:37:33 +0000 (15:37 -0400)]
Merge pull request #14483 from opensourcerouting/fix/ignore_setting_ttl_for_negative_socket

bgpd: Set the TTL for the correct socket

19 months agobgpd: fix printing link state ospf opaque data 14506/head
Louis Scalbert [Thu, 28 Sep 2023 15:38:13 +0000 (17:38 +0200)]
bgpd: fix printing link state ospf opaque data

Fix printing link state ospf opaque data. pnt address was not moving
in the loop.

Fixes: 8b531b1107 ("bgpd: store and send bgp link-state attributes")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
19 months agodoc: add debian 12 build docs to toctree 14507/head
Quentin Young [Thu, 28 Sep 2023 15:51:53 +0000 (11:51 -0400)]
doc: add debian 12 build docs to toctree

Not reachable without this

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
19 months agodoc: remove northbound _sidebar definition
Quentin Young [Thu, 28 Sep 2023 16:03:28 +0000 (12:03 -0400)]
doc: remove northbound _sidebar definition

This ain't a wiki

But retain the ordering set up in the _sidebar in the RST index

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
19 months agodoc: couple nbapi doc cleanups
Quentin Young [Thu, 28 Sep 2023 15:45:49 +0000 (11:45 -0400)]
doc: couple nbapi doc cleanups

* Fix block quote & rfc link
* Fix note block re: libyang dependencies

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
19 months agodoc: fixup nbapi doc images
Quentin Young [Thu, 28 Sep 2023 15:44:59 +0000 (11:44 -0400)]
doc: fixup nbapi doc images

Pulled from web hosting into repo, all figure blocks updated.

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
19 months agobgpd: fix insecure data write with area addresses
Louis Scalbert [Thu, 28 Sep 2023 14:55:43 +0000 (16:55 +0200)]
bgpd: fix insecure data write with area addresses

Fix an issue where an attacker may inject a tainted length value to
corrupt the memory.

> CID 1568380 (#1 of 1): Untrusted value as argument (TAINTED_SCALAR)
> 9. tainted_data: Passing tainted expression length to bgp_linkstate_nlri_value_display, which uses it as an offset

Fixes: 8b531b1107 ("bgpd: store and send bgp link-state attributes") Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
19 months agobgpd: fix insecure data write with ip addresses
Louis Scalbert [Thu, 28 Sep 2023 14:53:35 +0000 (16:53 +0200)]
bgpd: fix insecure data write with ip addresses

Fix issues where an attacker may inject a tainted length value to
corrupt the memory.

> CID 1568378 (#1-6 of 6): Untrusted value as argument (TAINTED_SCALAR)
> 16. tainted_data: Passing tainted expression length to bgp_linkstate_tlv_attribute_value_display, which uses it as an offset. [show details]

Fixes: 7e0d9ff8ba ("bgpd: display link-state prefixes detail")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
19 months agodoc: unpin sphinx from 4.0.2 14505/head
Quentin Young [Thu, 28 Sep 2023 14:49:37 +0000 (10:49 -0400)]
doc: unpin sphinx from 4.0.2

requirements.txt was pinning sphinx at a very old version. This version
doesn't work in recent versions of Python; the new RTD configuration
made RTD respect our requirements file, breaking the build.

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
19 months agobgpd: fix link_state_hash_cmp()
Louis Scalbert [Thu, 28 Sep 2023 13:33:58 +0000 (15:33 +0200)]
bgpd: fix link_state_hash_cmp()

Fix comparaison of link state attributes pointers in
link_state_hash_cmp().

> CID 1568379 (#1 of 1): Logically dead code (DEADCODE)
> dead_error_line: Execution cannot reach this statement: return false;.

Fixes: 8b531b1107 ("bgpd: store and send bgp link-state attributes")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
19 months agobgpd: fix illegal memory access in bgp_ls_tlv_check_size()
Louis Scalbert [Thu, 28 Sep 2023 13:27:27 +0000 (15:27 +0200)]
bgpd: fix illegal memory access in bgp_ls_tlv_check_size()

Fix illegal memory access bgp_ls_tlv_check_size() if type is 1253.

> CID 1568377 (#4 of 4): Out-of-bounds read (OVERRUN)
> 5. overrun-local: Overrunning array bgp_linkstate_tlv_infos of 1253 16-byte elements at element index 1253 (byte offset 20063) using index type (which evaluates to 1253).

Fixes: 7e0d9ff8ba ("bgpd: display link-state prefixes detail")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
19 months agobgpd: do not check attr in bgp_packet_attribute
Louis Scalbert [Thu, 28 Sep 2023 13:08:23 +0000 (15:08 +0200)]
bgpd: do not check attr in bgp_packet_attribute

Fix the following coverity issue. attr cannot be NULL.

> CID 1568376 (#1 of 1): Dereference before null check (REVERSE_INULL)
> check_after_deref: Null-checking attr suggests that it may be null, but it has already been dereferenced on all paths leading to the check.

Fixes: 8b531b1107 ("bgpd: store and send bgp link-state attributes")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
19 months agoMerge pull request #14494 from idryzhov/mgmtd-show-datastore-contents-crash
Donald Sharp [Thu, 28 Sep 2023 13:06:11 +0000 (09:06 -0400)]
Merge pull request #14494 from idryzhov/mgmtd-show-datastore-contents-crash

mgmtd: fix crash on "show mgmtd datastore-contents"

19 months agoMerge pull request #14502 from opensourcerouting/fix/document_on_how_to_set_the_dista...
Donald Sharp [Thu, 28 Sep 2023 12:15:25 +0000 (08:15 -0400)]
Merge pull request #14502 from opensourcerouting/fix/document_on_how_to_set_the_distance_from_linux

doc: Add an example on how to set a distance for a route from the kernel

19 months agodoc: Add `neighbor capability dynamic` command 14503/head
Donatas Abraitis [Thu, 28 Sep 2023 10:13:52 +0000 (13:13 +0300)]
doc: Add `neighbor capability dynamic` command

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agodoc: Add an example on how to set a distance for a route from the kernel 14502/head
Donatas Abraitis [Thu, 28 Sep 2023 07:44:45 +0000 (10:44 +0300)]
doc: Add an example on how to set a distance for a route from the kernel

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agoMerge pull request #14500 from qlyoung/add-rtd-config
Donatas Abraitis [Thu, 28 Sep 2023 09:36:29 +0000 (12:36 +0300)]
Merge pull request #14500 from qlyoung/add-rtd-config

doc: add .readthedocs.yaml configs

19 months agoMerge pull request #14499 from qlyoung/fix-doc-whitespace-toctree
Donatas Abraitis [Thu, 28 Sep 2023 09:36:19 +0000 (12:36 +0300)]
Merge pull request #14499 from qlyoung/fix-doc-whitespace-toctree

fix various developer doc issues

19 months agoMerge pull request #14498 from idryzhov/fix-conf-t-file-lock
Donatas Abraitis [Thu, 28 Sep 2023 07:03:06 +0000 (10:03 +0300)]
Merge pull request #14498 from idryzhov/fix-conf-t-file-lock

Fixes for `file-lock` mode of configuration node

19 months agodoc: add .readthedocs.yaml configs 14500/head
Quentin Young [Thu, 28 Sep 2023 00:14:46 +0000 (20:14 -0400)]
doc: add .readthedocs.yaml configs

As of Sep 25 2023, RTD projects require config files to build. This
patch is necessary for docs to continue to build.

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
19 months agodoc: include checkpatch & cspf docs in toctree 14499/head
Quentin Young [Wed, 27 Sep 2023 23:54:02 +0000 (19:54 -0400)]
doc: include checkpatch & cspf docs in toctree

The documentation pages on checkpatch and CSPF were not reachable
because they were not included in any toctree. Include them in the tree!

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
19 months agodoc: fix whitespace, formatting errors
Quentin Young [Wed, 27 Sep 2023 23:53:10 +0000 (19:53 -0400)]
doc: fix whitespace, formatting errors

* Fix various whitespace and syntax errors
* Fix a couple tiny grammar mistakes

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
19 months agovtysh: fix entering configuration node in file-lock mode 14498/head
Igor Ryzhov [Wed, 27 Sep 2023 23:45:05 +0000 (02:45 +0300)]
vtysh: fix entering configuration node in file-lock mode

When the config node is entered in file-lock mode, we should actually
remember it to correctly apply the workaround in `vtysh_exit`.
Otherwise, the file-lock mode is dropped once we exit any node one level
below the config node.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
19 months agovty: fix working in file-lock mode
Igor Ryzhov [Wed, 27 Sep 2023 23:41:16 +0000 (02:41 +0300)]
vty: fix working in file-lock mode

When the configuration node is entered in file-lock mode, candidate
and running datastores are locked. Any configuration change is followed
by an implicit commit which leads to a crash of mgmtd, because double
lock is prohibited by an assert. When working in file-lock mode, we
shouldn't do implicit commits which is disabled by allowing pending
configuration changes.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
19 months agoMerge pull request #14222 from opensourcerouting/doc/debian12
Jafar Al-Gharaibeh [Wed, 27 Sep 2023 22:46:40 +0000 (17:46 -0500)]
Merge pull request #14222 from opensourcerouting/doc/debian12

[DOC] Debian 12

19 months agoMerge pull request #14495 from opensourcerouting/fix/update_releases_table
Jafar Al-Gharaibeh [Wed, 27 Sep 2023 22:45:05 +0000 (17:45 -0500)]
Merge pull request #14495 from opensourcerouting/fix/update_releases_table

doc: Fix release dates in workflow

19 months agovty: fix configure terminal argument descriptions
Igor Ryzhov [Wed, 27 Sep 2023 20:34:53 +0000 (23:34 +0300)]
vty: fix configure terminal argument descriptions

"terminal" and "file-lock" description are mixed up.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
19 months agoMerge pull request #14342 from fdumontet6WIND/fix_crash_snmp
Donald Sharp [Wed, 27 Sep 2023 19:25:38 +0000 (15:25 -0400)]
Merge pull request #14342 from fdumontet6WIND/fix_crash_snmp

bgpd: fix crash in *bgpv2PeerErrorsTable"

19 months agodoc: Use backward order when for release dates hint 14495/head
Donatas Abraitis [Wed, 27 Sep 2023 13:49:16 +0000 (16:49 +0300)]
doc: Use backward order when for release dates hint

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agodoc: Fix release dates in workflow
Donatas Abraitis [Wed, 27 Sep 2023 13:45:01 +0000 (16:45 +0300)]
doc: Fix release dates in workflow

Align to the release rules:

Releases are scheduled in a 4-month cycle on the first Tuesday each March/July/November.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agoMerge pull request #14482 from opensourcerouting/fix/walltime_threshold_disable
Donald Sharp [Wed, 27 Sep 2023 10:32:11 +0000 (06:32 -0400)]
Merge pull request #14482 from opensourcerouting/fix/walltime_threshold_disable

lib: Drop deprecated enable-time-check, enable-cpu-time compile options

19 months agomgmtd: fix crash on "show mgmtd datastore-contents" 14494/head
Igor Ryzhov [Wed, 27 Sep 2023 10:22:01 +0000 (13:22 +0300)]
mgmtd: fix crash on "show mgmtd datastore-contents"

When the command is called without specifying the datastore, it crashes.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
19 months agodoc: Add Debian 12 Build documentation 14222/head
Martin Winter [Tue, 26 Sep 2023 15:44:06 +0000 (17:44 +0200)]
doc: Add Debian 12 Build documentation

Signed-off-by: Rodrigo Nardi <rnardi@netdef.org>
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
19 months agoMerge pull request #14447 from marcos-ng/master
Russ White [Tue, 26 Sep 2023 15:43:17 +0000 (11:43 -0400)]
Merge pull request #14447 from marcos-ng/master

doc: reference the correct MGMTd show command

19 months agoMerge pull request #14356 from Keelan10/ospf_external_aggregator-leak
Russ White [Tue, 26 Sep 2023 14:18:08 +0000 (10:18 -0400)]
Merge pull request #14356 from Keelan10/ospf_external_aggregator-leak

ospfd: Fix External Aggregator Leak

19 months agoMerge pull request #12649 from louis-6wind/bgp-link-state
Russ White [Tue, 26 Sep 2023 14:07:02 +0000 (10:07 -0400)]
Merge pull request #12649 from louis-6wind/bgp-link-state

bgpd: add basic support of BGP Link-State RFC7752

19 months agobgpd: Set the TTL for the correct socket 14483/head
Donatas Abraitis [Mon, 25 Sep 2023 14:07:56 +0000 (17:07 +0300)]
bgpd: Set the TTL for the correct socket

When we accept a connection, we try to set TTL for the socket, but the socket
is not yet created/assigned and we are trying to set it on the wrong socket fd.

```
[Event] connection from 127.0.0.1 fd 25, active peer status 3 fd -1
can't set sockopt IP_TTL 255 to socket -1
bgp_set_socket_ttl: Can't set TxTTL on peer (rtrid 0.0.0.0) socket, err = 9
Unable to set min/max TTL on peer 127.0.0.1, Continuing
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agoMerge pull request #14487 from opensourcerouting/fix/doc_bullet_new_line_missing
Donald Sharp [Mon, 25 Sep 2023 13:57:00 +0000 (09:57 -0400)]
Merge pull request #14487 from opensourcerouting/fix/doc_bullet_new_line_missing

Some recent documentation adjustments

19 months agoMerge pull request #14484 from opensourcerouting/coverity-20230924
Donald Sharp [Mon, 25 Sep 2023 13:52:23 +0000 (09:52 -0400)]
Merge pull request #14484 from opensourcerouting/coverity-20230924

lib: assert for VTY_PASSFD expectations

19 months agodoc: Use different label to distinguish PBR nexthop groups 14487/head
Donatas Abraitis [Mon, 25 Sep 2023 06:33:02 +0000 (09:33 +0300)]
doc: Use different label to distinguish PBR nexthop groups

/root/frr/doc/user/pbr.rst:32: WARNING: duplicate label nexthop-groups, other instance in /root/frr/doc/user/nexthop_groups.rst

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agodoc: Replace `frr` code highlighting marker to `sh`
Donatas Abraitis [Mon, 25 Sep 2023 06:28:42 +0000 (09:28 +0300)]
doc: Replace `frr` code highlighting marker to `sh`

No such thing exists.

 /root/frr/doc/user/ospfd.rst:624: WARNING: Cannot analyze code. No Pygments lexer found for "frr".

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agodoc: Drop bullet point from ospfd documentation
Donatas Abraitis [Mon, 25 Sep 2023 06:27:21 +0000 (09:27 +0300)]
doc: Drop bullet point from ospfd documentation

/root/frr/doc/user/ospfd.rst:609: WARNING: Bullet list ends without a blank line; unexpected unindent.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agolib: assert for VTY_PASSFD expectations 14484/head
David Lamparter [Sun, 24 Sep 2023 18:12:42 +0000 (20:12 +0200)]
lib: assert for VTY_PASSFD expectations

Coverity is complaining that vty->state could be VTY_PASSFD here.  It
can't, it really shouldn't, and if it actually is then something went
seriously wrong somewhere earlier so assert()ing out is the best thing
to do.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
19 months agoMerge pull request #14467 from cscarpitta/bugfix/fix-srv6-isis-memleaks
Donatas Abraitis [Sun, 24 Sep 2023 17:47:15 +0000 (20:47 +0300)]
Merge pull request #14467 from cscarpitta/bugfix/fix-srv6-isis-memleaks

isisd: Fix memory leaks when IS-IS fails to process an SRv6 locator chunk

19 months agoMerge pull request #14473 from cscarpitta/bugfix/fix-srv6-topotest-warning
Donatas Abraitis [Sun, 24 Sep 2023 17:47:07 +0000 (20:47 +0300)]
Merge pull request #14473 from cscarpitta/bugfix/fix-srv6-topotest-warning

tests: Fix DeprecationWarning in SRv6 L3VPN topotest

19 months agolib: Drop deprecated enable-time-check, enable-cpu-time compile options 14482/head
Donatas Abraitis [Sun, 24 Sep 2023 17:41:24 +0000 (20:41 +0300)]
lib: Drop deprecated enable-time-check, enable-cpu-time compile options

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agoMerge pull request #14468 from donaldsharp/bgp_send_ordering
Donatas Abraitis [Sun, 24 Sep 2023 13:48:44 +0000 (16:48 +0300)]
Merge pull request #14468 from donaldsharp/bgp_send_ordering

bgpd: Ensure send order is 100% consistent

19 months agoMerge pull request #14476 from anlancs/fix/pimd-remove-fd-close
Donald Sharp [Sat, 23 Sep 2023 22:43:43 +0000 (18:43 -0400)]
Merge pull request #14476 from anlancs/fix/pimd-remove-fd-close

pimd: remove redundant closing socket

19 months agoMerge pull request #14475 from opensourcerouting/fix/unset_per_afi_stuff_when_dynamic...
Donald Sharp [Sat, 23 Sep 2023 13:51:47 +0000 (09:51 -0400)]
Merge pull request #14475 from opensourcerouting/fix/unset_per_afi_stuff_when_dynamic_UNSET_received

Clear per afi/safi stuff for GR/LLGR when dynamic capability with UNSET action received

19 months agoMerge pull request #14464 from opensourcerouting/fix/dampening_crash
Donald Sharp [Sat, 23 Sep 2023 13:51:01 +0000 (09:51 -0400)]
Merge pull request #14464 from opensourcerouting/fix/dampening_crash

bgpd: Fix dampening info crash

19 months agoMerge pull request #14470 from opensourcerouting/fix/rewrite_dynamic_capabilities_tests
Donald Sharp [Sat, 23 Sep 2023 13:50:43 +0000 (09:50 -0400)]
Merge pull request #14470 from opensourcerouting/fix/rewrite_dynamic_capabilities_tests

tests: Improve BGP dynamic capability tests

19 months agopimd: remove redundant closing socket 14476/head
anlan_cs [Sat, 23 Sep 2023 12:50:30 +0000 (20:50 +0800)]
pimd: remove redundant closing socket

The socket has been closed in `ssmpingd_setsockopt()` in the wrong cases,
so remove the redundant closing socket from outer layer.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
19 months agobgpd: Flush per AFI/SAFI capabilities flags, stale_time for LLGR cap 14475/head
Donatas Abraitis [Fri, 22 Sep 2023 17:37:56 +0000 (20:37 +0300)]
bgpd: Flush per AFI/SAFI capabilities flags, stale_time for LLGR cap

Clear to defaults if receiving dynamic capability with UNSET action.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobgpd: Clear graceful-restart per AFI/SAFI capability flags when receiving unset
Donatas Abraitis [Fri, 22 Sep 2023 17:35:06 +0000 (20:35 +0300)]
bgpd: Clear graceful-restart per AFI/SAFI capability flags when receiving unset

We flushed the main capability received flag, but missed flushing per AFI/SAFI.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agotests: Fix DeprecationWarning in SRv6 L3VPN topotest 14473/head
Carmine Scarpitta [Fri, 22 Sep 2023 16:43:33 +0000 (18:43 +0200)]
tests: Fix DeprecationWarning in SRv6 L3VPN topotest

Fix the following warning:

tests/topotests/bgp_srv6l3vpn_sid/test_bgp_srv6l3vpn_sid.py:42
  /media/SharedUTM/workspace/frr/tests/topotests/bgp_srv6l3vpn_sid/test_bgp_srv6l3vpn_sid.py:42: DeprecationWarning: invalid escape sequence '\ '

In test_bgp_srv6l3vpn_sid.py we have a comment containing some '\'
characters. Python mistakenly tries to interpret such "\" characters
as escape sequences, which leads to the above warning.

Let's tell Python to treat the comment as a raw string,
so that it simply treats backslashes as literal characters rather than
escape sequences.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
19 months agolib: don't announce prefix delete for duplicates 14472/head
Rafael Zalamena [Fri, 22 Sep 2023 15:28:38 +0000 (12:28 -0300)]
lib: don't announce prefix delete for duplicates

When deleting a duplicated prefix list entry don't announce the change
to route map listeners, otherwise they will be removing rules that
shouldn't be removed causing the prefix that still exist in the
prefix-list to be not evaluated anymore.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
19 months agoRevert "lib : fix duplicate prefix list delete"
Rafael Zalamena [Fri, 22 Sep 2023 15:24:16 +0000 (12:24 -0300)]
Revert "lib : fix duplicate prefix list delete"

This reverts commit 394ed767e7207805a6d916b01b1f1d4743c03dd1.

19 months agoMerge pull request #14450 from kuldeepkash/general_fixes
Donald Sharp [Fri, 22 Sep 2023 13:53:03 +0000 (09:53 -0400)]
Merge pull request #14450 from kuldeepkash/general_fixes

tests: Adding BGP convergence verification before starting PIM tests

19 months agoMerge pull request #14458 from opensourcerouting/fix/update_doc_for_vtysh
Donald Sharp [Fri, 22 Sep 2023 13:51:01 +0000 (09:51 -0400)]
Merge pull request #14458 from opensourcerouting/fix/update_doc_for_vtysh

doc: domainname MUST be manually written to vtysh.conf also

19 months agoMerge pull request #14463 from mjstapp/fix_bgp_ctime_r
Donald Sharp [Fri, 22 Sep 2023 13:47:33 +0000 (09:47 -0400)]
Merge pull request #14463 from mjstapp/fix_bgp_ctime_r

bgpd: fix return of local from ctime_r

19 months agoMerge pull request #14466 from mjstapp/fix_ospfd_snmp_ptrs
Donald Sharp [Fri, 22 Sep 2023 13:46:52 +0000 (09:46 -0400)]
Merge pull request #14466 from mjstapp/fix_ospfd_snmp_ptrs

bgpd, ospfd: fix some dicey pointer arith in snmp modules

19 months agotests: Check notification/capability received message stats instead of reset/established 14470/head
Donatas Abraitis [Fri, 22 Sep 2023 12:50:27 +0000 (15:50 +0300)]
tests: Check notification/capability received message stats instead of reset/established

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agotests: Use frr.conf for bgp_dynamic_capabily tests
Donatas Abraitis [Fri, 22 Sep 2023 12:20:22 +0000 (15:20 +0300)]
tests: Use frr.conf for bgp_dynamic_capabily tests

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobgpd: Use proper AFI when dumping information for dampening stuff 14464/head
Donatas Abraitis [Thu, 21 Sep 2023 13:08:50 +0000 (16:08 +0300)]
bgpd: Use proper AFI when dumping information for dampening stuff

Before we called IPv4 for IPv6 dampening info.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobgpd: Initialise timebuf arrays to zeros for dampening reuse timer
Donatas Abraitis [Thu, 21 Sep 2023 13:00:10 +0000 (16:00 +0300)]
bgpd: Initialise timebuf arrays to zeros for dampening reuse timer

Avoid having something like this in outputs:

Before:
```
munet> r1 shi vtysh -c 'show bgp dampening damp'
BGP table version is 10, local router ID is 10.10.10.1, vrf id 0
Default local pref 100, local AS 65001
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

   Network          From             Reuse    Path
 *d 2001:db8:1::1/128
                    2001:db8::2      (null) 65002 ?
 *d 2001:db8:2::1/128
                    2001:db8::2      (null) 65002 ?
 *d 2001:db8:3::1/128
                    2001:db8::2      (null) 65002 ?
 *d 2001:db8:4::1/128
                    2001:db8::2      (null) 65002 ?
 *d 2001:db8:5::1/128
                    2001:db8::2      (null) 65002 ?

Displayed  5 routes and 5 total paths

munet> r1 shi vtysh -c 'show bgp dampening flap'
BGP table version is 10, local router ID is 10.10.10.1, vrf id 0
Default local pref 100, local AS 65001
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

   Network          From            Flaps Duration Reuse    Path
 *d 2001:db8:1::1/128
                    2001:db8::2     2    00:03:10 (null) 65002 ?
 *d 2001:db8:2::1/128
                    2001:db8::2     2    00:03:10 (null) 65002 ?
 *d 2001:db8:3::1/128
                    2001:db8::2     2    00:03:10 (null) 65002 ?
 *d 2001:db8:4::1/128
                    2001:db8::2     2    00:03:10 (null) 65002 ?
 *d 2001:db8:5::1/128
                    2001:db8::2     2    00:03:10 (null) 65002 ?

Displayed  5 routes and 5 total paths
```

After:

```
munet> r1 shi vtysh -c 'show bgp dampening damp '
BGP table version is 10, local router ID is 10.10.10.1, vrf id 0
Default local pref 100, local AS 65001
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

   Network          From             Reuse    Path
 *d 2001:db8:1::1/128
                    2001:db8::2      00:00:00 65002 ?
 *d 2001:db8:2::1/128
                    2001:db8::2      00:00:00 65002 ?
 *d 2001:db8:3::1/128
                    2001:db8::2      00:00:00 65002 ?
 *d 2001:db8:4::1/128
                    2001:db8::2      00:00:00 65002 ?
 *d 2001:db8:5::1/128
                    2001:db8::2      00:00:00 65002 ?

Displayed  5 routes and 5 total paths

munet> r1 shi vtysh -c 'show bgp dampening flap'
BGP table version is 10, local router ID is 10.10.10.1, vrf id 0
Default local pref 100, local AS 65001
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

   Network          From            Flaps Duration Reuse    Path
 *d 2001:db8:1::1/128
                    2001:db8::2     2    00:00:15 00:00:00 65002 ?
 *d 2001:db8:2::1/128
                    2001:db8::2     2    00:00:15 00:00:00 65002 ?
 *d 2001:db8:3::1/128
                    2001:db8::2     2    00:00:15 00:00:00 65002 ?
 *d 2001:db8:4::1/128
                    2001:db8::2     2    00:00:15 00:00:00 65002 ?
 *d 2001:db8:5::1/128
                    2001:db8::2     2    00:00:15 00:00:00 65002 ?

Displayed  5 routes and 5 total paths
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobgpd: Make sure dampening is enabled for the specified AFI/SAFI
Donatas Abraitis [Thu, 21 Sep 2023 12:37:17 +0000 (15:37 +0300)]
bgpd: Make sure dampening is enabled for the specified AFI/SAFI

```
(gdb) bt
0  raise (sig=sig@entry=11) at ../sysdeps/unix/sysv/linux/raise.c:50
1  0x00007f55897c6ab0 in core_handler (signo=11, siginfo=0x7ffd19764bb0, context=<optimized out>) at lib/sigevent.c:246
2  <signal handler called>
3  0x00005624ccabdee9 in bgp_get_reuse_time (penalty=<optimized out>, buf=buf@entry=0x7ffd19765590 "", len=len@entry=25, afi=afi@entry=AFI_IP, safi=safi@entry=SAFI_UNICAST, use_json=<optimized out>, json=0x0)
    at bgpd/bgp_damp.c:498
4  0x00005624ccabf5e7 in bgp_damp_reuse_time_vty (vty=vty@entry=0x5624ce484e30, path=path@entry=0x5624cdd797a0, timebuf=timebuf@entry=0x7ffd19765590 "", len=len@entry=25, afi=afi@entry=AFI_IP,
    safi=safi@entry=SAFI_UNICAST, use_json=false, json=0x0) at bgpd/bgp_damp.c:635
5  0x00005624cca146a9 in damp_route_vty_out (afi=AFI_IP, json_paths=0x0, use_json=false, safi=SAFI_UNICAST, display=<optimized out>, path=0x5624cdd797a0, p=0x5624ce3f3160, vty=0x5624ce484e30)
    at bgpd/bgp_route.c:9852
6  bgp_show_table (vty=0x5624ce484e30, bgp=0x5624ce400950, safi=safi@entry=SAFI_UNICAST, table=0x5624ce409300, type=type@entry=bgp_show_type_dampend_paths, output_arg=0x0, rd=0x0, is_last=1, output_cum=0x0,
    total_cum=0x0, json_header_depth=0x7ffd19765830, show_flags=0, rpki_target_state=RPKI_NOT_BEING_USED) at bgpd/bgp_route.c:11448
7  0x00005624cca15f74 in bgp_show (vty=vty@entry=0x5624ce484e30, bgp=<optimized out>, afi=<optimized out>, safi=<optimized out>, type=type@entry=bgp_show_type_dampend_paths, output_arg=output_arg@entry=0x0,
    show_flags=0, rpki_target_state=RPKI_NOT_BEING_USED) at bgpd/bgp_route.c:11702
8  0x00005624cca17679 in show_ip_bgp_magic (self=<optimized out>, viewvrfname=<optimized out>, aa_nn=<optimized out>, community_list=<optimized out>, community_list_str=<optimized out>,
    community_list_name=<optimized out>, as_path_filter_name=<optimized out>, prefix_list=<optimized out>, accesslist_name=<optimized out>, rmap_name=<optimized out>, version=<optimized out>,
    version_str=<optimized out>, alias_name=<optimized out>, wide=<optimized out>, detail_json=<optimized out>, uj=<optimized out>, detail_routes=<optimized out>, all=<optimized out>, argv=0x5624ce3f32f0,
    argc=<optimized out>, vty=0x5624ce484e30) at bgpd/bgp_route.c:12863
9  show_ip_bgp (self=<optimized out>, vty=<optimized out>, argc=<optimized out>, argv=0x5624ce3f32f0) at ./bgpd/bgp_route_clippy.c:514
10 0x00007f55897618ee in cmd_execute_command_real (vline=vline@entry=0x5624ce427020, vty=vty@entry=0x5624ce484e30, cmd=cmd@entry=0x0, up_level=up_level@entry=0) at lib/command.c:993
11 0x00007f5589761a91 in cmd_execute_command (vline=vline@entry=0x5624ce427020, vty=vty@entry=0x5624ce484e30, cmd=0x0, vtysh=vtysh@entry=0) at lib/command.c:1051
12 0x00007f5589761c30 in cmd_execute (vty=vty@entry=0x5624ce484e30, cmd=cmd@entry=0x5624ce47b1b0 "show bgp dampening damp", matched=matched@entry=0x0, vtysh=vtysh@entry=0) at lib/command.c:1218
13 0x00007f55897de95e in vty_command (vty=vty@entry=0x5624ce484e30, buf=<optimized out>) at lib/vty.c:591
14 0x00007f55897deb9d in vty_execute (vty=0x5624ce484e30) at lib/vty.c:1354
15 0x00007f55897e23eb in vtysh_read (thread=<optimized out>) at lib/vty.c:2362
16 0x00007f55897d9426 in event_call (thread=thread@entry=0x7ffd19767e70) at lib/event.c:1971
17 0x00007f5589789df8 in frr_run (master=0x5624cdc42100) at lib/libfrr.c:1213
18 0x00005624cc985f65 in main (argc=<optimized out>, argv=0x7ffd197680d8) at bgpd/bgp_main.c:510
(gdb) frame 4
(gdb) p damp[1][1]
$4 = {suppress_value = 0, reuse_limit = 0, max_suppress_time = 0, half_life = 0, tmax = 0, reuse_list_size = 0, reuse_index_size = 0, ceiling = 0, decay_rate_per_tick = 0, decay_array_size = 0,
  scale_factor = 0, reuse_scale_factor = 0, decay_array = 0x0, reuse_index = 0x0, reuse_list = 0x0, reuse_offset = 0, no_reuse_list = 0x0, t_reuse = 0x0, afi = AFI_UNSPEC, safi = SAFI_UNSPEC}
(gdb) p damp[2][1]
$5 = {suppress_value = 1, reuse_limit = 1, max_suppress_time = 1800, half_life = 60, tmax = 0, reuse_list_size = 181, reuse_index_size = 1024, ceiling = 1073741824, decay_rate_per_tick = 0,
  decay_array_size = 360, scale_factor = 9.5367431729442842e-07, reuse_scale_factor = 0, decay_array = 0x5624ce483780, reuse_index = 0x5624ce481320, reuse_list = 0x5624ce482c20, reuse_offset = 7,
  no_reuse_list = 0x0, t_reuse = 0x5624ce3ec840, afi = AFI_UNSPEC, safi = SAFI_UNSPEC}
(gdb)
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobgpd: Ensure send order is 100% consistent 14468/head
Donald Sharp [Thu, 21 Sep 2023 19:30:08 +0000 (15:30 -0400)]
bgpd: Ensure send order is 100% consistent

When BGP is sending updates to peers on a neighbor up event
it was noticed that the bgp updates being sent were in reverse
order being sent to the first peer.

Imagine r1 -- r2 -- r3.  r1 and r2 are ebgp peers and
r2 and r3 are ebgp peers.  r1's interface to r2 is currently
shutdown.  Prior to this fix the send order would look like this:

r1 -> r2 send of routes to r2 and then they would be installed in order
received:

10.0.0.12 nhid 39 via 192.168.8.2 dev leaf2-eth5 proto bgp metric 20
10.0.0.11 nhid 39 via 192.168.8.2 dev leaf2-eth5 proto bgp metric 20
10.0.0.10 nhid 39 via 192.168.8.2 dev leaf2-eth5 proto bgp metric 20
10.0.0.9 nhid 39 via 192.168.8.2 dev leaf2-eth5 proto bgp metric 20
10.0.0.8 nhid 39 via 192.168.8.2 dev leaf2-eth5 proto bgp metric 20
10.0.0.7 nhid 39 via 192.168.8.2 dev leaf2-eth5 proto bgp metric 20
10.0.0.6 nhid 39 via 192.168.8.2 dev leaf2-eth5 proto bgp metric 20
10.0.0.5 nhid 39 via 192.168.8.2 dev leaf2-eth5 proto bgp metric 20
10.0.0.4 nhid 39 via 192.168.8.2 dev leaf2-eth5 proto bgp metric 20
10.0.0.3 nhid 39 via 192.168.8.2 dev leaf2-eth5 proto bgp metric 20
10.0.0.2 nhid 39 via 192.168.8.2 dev leaf2-eth5 proto bgp metric 20
10.0.0.1 nhid 39 via 192.168.8.2 dev leaf2-eth5 proto bgp metric 20

r2 would then send these routes to r3 and then they would be installed
in order received:

10.0.0.1 nhid 12 via 192.168.61.2 dev spine2-eth1 proto bgp metric 20
10.0.0.2 nhid 12 via 192.168.61.2 dev spine2-eth1 proto bgp metric 20
10.0.0.3 nhid 12 via 192.168.61.2 dev spine2-eth1 proto bgp metric 20
10.0.0.4 nhid 12 via 192.168.61.2 dev spine2-eth1 proto bgp metric 20
10.0.0.5 nhid 12 via 192.168.61.2 dev spine2-eth1 proto bgp metric 20
10.0.0.6 nhid 12 via 192.168.61.2 dev spine2-eth1 proto bgp metric 20
10.0.0.7 nhid 12 via 192.168.61.2 dev spine2-eth1 proto bgp metric 20
10.0.0.8 nhid 12 via 192.168.61.2 dev spine2-eth1 proto bgp metric 20
10.0.0.9 nhid 12 via 192.168.61.2 dev spine2-eth1 proto bgp metric 20
10.0.0.10 nhid 12 via 192.168.61.2 dev spine2-eth1 proto bgp metric 20
10.0.0.11 nhid 12 via 192.168.61.2 dev spine2-eth1 proto bgp metric 20
10.0.0.12 nhid 12 via 192.168.61.2 dev spine2-eth1 proto bgp metric 20

Not that big of a deal right?  Well imagine a situation where r1 is
originating several ten's of thousands of routes.  It sends routes to r2
r2 is processing routes but in reverse order and at the same time it
is sending routes to r3, in the correct order of the bgp table.

r3 will have the early 10.0.0.1/32 routes installed and start forwarding
while r2 will not have those routes installed yet( since they were at the
end and zebra is slightly slower for processing routes than bgp is ).

Ensure that the order sent is a true FIFO.  What is happening is that
there is an update fifo which stores all routes.  And off that FIFO
is a bgp advertise attribute list which stores the list of prefixes
which share the same attribute that allow for more efficient packing
this list was being stored in reverse order causing the problem for
the initial send.  When adding items to this list put them at the
end so we keep the fifo order that is traversed when we walk through
the bgp table.

After the fix:

r2 installation order:

10.0.0.0 nhid 39 via 192.168.8.2 dev leaf2-eth5 proto bgp metric 20
10.0.0.1 nhid 39 via 192.168.8.2 dev leaf2-eth5 proto bgp metric 20
10.0.0.2 nhid 39 via 192.168.8.2 dev leaf2-eth5 proto bgp metric 20
10.0.0.3 nhid 39 via 192.168.8.2 dev leaf2-eth5 proto bgp metric 20
10.0.0.4 nhid 39 via 192.168.8.2 dev leaf2-eth5 proto bgp metric 20
10.0.0.5 nhid 39 via 192.168.8.2 dev leaf2-eth5 proto bgp metric 20
10.0.0.6 nhid 39 via 192.168.8.2 dev leaf2-eth5 proto bgp metric 20
10.0.0.7 nhid 39 via 192.168.8.2 dev leaf2-eth5 proto bgp metric 20
10.0.0.8 nhid 39 via 192.168.8.2 dev leaf2-eth5 proto bgp metric 20
10.0.0.9 nhid 39 via 192.168.8.2 dev leaf2-eth5 proto bgp metric 20
10.0.0.10 nhid 39 via 192.168.8.2 dev leaf2-eth5 proto bgp metric 20
10.0.0.11 nhid 39 via 192.168.8.2 dev leaf2-eth5 proto bgp metric 20
10.0.0.12 nhid 39 via 192.168.8.2 dev leaf2-eth5 proto bgp metric 20

r3 installation order:

10.0.0.0 nhid 12 via 192.168.61.2 dev spine2-eth1 proto bgp metric 20
10.0.0.1 nhid 12 via 192.168.61.2 dev spine2-eth1 proto bgp metric 20
10.0.0.2 nhid 12 via 192.168.61.2 dev spine2-eth1 proto bgp metric 20
10.0.0.3 nhid 12 via 192.168.61.2 dev spine2-eth1 proto bgp metric 20
10.0.0.4 nhid 12 via 192.168.61.2 dev spine2-eth1 proto bgp metric 20
10.0.0.5 nhid 12 via 192.168.61.2 dev spine2-eth1 proto bgp metric 20
10.0.0.6 nhid 12 via 192.168.61.2 dev spine2-eth1 proto bgp metric 20
10.0.0.7 nhid 12 via 192.168.61.2 dev spine2-eth1 proto bgp metric 20
10.0.0.8 nhid 12 via 192.168.61.2 dev spine2-eth1 proto bgp metric 20
10.0.0.9 nhid 12 via 192.168.61.2 dev spine2-eth1 proto bgp metric 20
10.0.0.10 nhid 12 via 192.168.61.2 dev spine2-eth1 proto bgp metric 20
10.0.0.11 nhid 12 via 192.168.61.2 dev spine2-eth1 proto bgp metric 20
10.0.0.12 nhid 12 via 192.168.61.2 dev spine2-eth1 proto bgp metric 20

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agodoc: reference the correct MGMTd show command 14447/head
Marcos Mendoza [Thu, 21 Sep 2023 18:54:04 +0000 (12:54 -0600)]
doc: reference the correct MGMTd show command

Signed-off-by: Marcos Mendoza <mmendoza@netgate.com>
19 months agobgpd: fix pointer arithmetic in bgp snmp module 14466/head
Mark Stapp [Thu, 21 Sep 2023 17:30:06 +0000 (13:30 -0400)]
bgpd: fix pointer arithmetic in bgp snmp module

Fix a bgpd coverity warning in an snmp module.

Signed-off-by: Mark Stapp <mjs@labn.net>
19 months agoMerge pull request #14465 from donaldsharp/zebra_snmp_coverity
Mark Stapp [Thu, 21 Sep 2023 17:21:10 +0000 (13:21 -0400)]
Merge pull request #14465 from donaldsharp/zebra_snmp_coverity

zebra: Fix longstanding snmp coverity issue