]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
22 months agomgmtd: xpath is already NULL in the failure path 13646/head
Donald Sharp [Wed, 31 May 2023 11:54:10 +0000 (07:54 -0400)]
mgmtd: xpath is already NULL in the failure path

There is no way that xpath can ever be anything but NULL
in the failure path with the goto's.  Let's just remove
the goto's and return immediately.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
22 months agoMerge pull request #13632 from LabNConsulting/chopps/mgmt-avoid-race
Donald Sharp [Wed, 31 May 2023 11:28:50 +0000 (07:28 -0400)]
Merge pull request #13632 from LabNConsulting/chopps/mgmt-avoid-race

mgmtd: fix possible race btw read config and backend connection

22 months agoMerge pull request #13639 from opensourcerouting/ospf-timestamp-truncation
Donald Sharp [Wed, 31 May 2023 11:26:06 +0000 (07:26 -0400)]
Merge pull request #13639 from opensourcerouting/ospf-timestamp-truncation

ospfd, ospf6d: fix time_t truncation

23 months agoMerge pull request #13634 from yyuanam/fix_bgp_core
Donatas Abraitis [Wed, 31 May 2023 05:57:40 +0000 (08:57 +0300)]
Merge pull request #13634 from yyuanam/fix_bgp_core

bgpd: fix bgpd core when unintern attr

23 months agoMerge pull request #13635 from donaldsharp/give_ping_a_chance
Jafar Al-Gharaibeh [Tue, 30 May 2023 23:59:44 +0000 (18:59 -0500)]
Merge pull request #13635 from donaldsharp/give_ping_a_chance

tests: Actually loop if ping fails

23 months agobgpd: fix bgpd core when unintern attr 13634/head
Yuan Yuan [Tue, 30 May 2023 18:53:32 +0000 (18:53 +0000)]
bgpd: fix bgpd core when unintern attr

When the remote peer is neither EBGP nor confed, aspath is the
shadow copy of attr->aspath in bgp_packet_attribute(). Striping
AS4_PATH should not be done on the aspath directly, since
that would lead to bgpd core dump when unintern the attr.

Signed-off-by: Yuan Yuan <yyuanam@amazon.com>
23 months agoospfd, ospf6d: fix time_t truncation 13639/head
Renato Westphal [Tue, 30 May 2023 22:41:39 +0000 (19:41 -0300)]
ospfd, ospf6d: fix time_t truncation

Change timestamp parameter from int to time_t to avoid truncation.

Found by Coverity Scan (CID 1563226 and 1563222)

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
23 months agotests: Actually loop if ping fails 13635/head
Donald Sharp [Tue, 30 May 2023 19:20:56 +0000 (15:20 -0400)]
tests: Actually loop if ping fails

The usage of run_and_expect doesn't work if the function
being called as the run part asserts.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
23 months agoMerge pull request #13631 from donaldsharp/fix_some_ping_issues
Donatas Abraitis [Tue, 30 May 2023 18:26:24 +0000 (21:26 +0300)]
Merge pull request #13631 from donaldsharp/fix_some_ping_issues

various issues

23 months agomgmtd: fix possible race btw read config and backend connection 13632/head
Christian Hopps [Tue, 30 May 2023 15:52:19 +0000 (11:52 -0400)]
mgmtd: fix possible race btw read config and backend connection

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agoMerge pull request #13601 from opensourcerouting/build-yang-embed-20230525
Donald Sharp [Tue, 30 May 2023 15:34:29 +0000 (11:34 -0400)]
Merge pull request #13601 from opensourcerouting/build-yang-embed-20230525

build: fix missing YANG model embedding

23 months agoMerge pull request #13588 from sri-mohan1/srib-ldpd1
mobash-rasool [Tue, 30 May 2023 15:32:31 +0000 (21:02 +0530)]
Merge pull request #13588 from sri-mohan1/srib-ldpd1

ldpd: changes for code maintainability

23 months agoMerge pull request #13414 from LabNConsulting/chopps/no-mgmtd-nowrite-on-off
Donald Sharp [Tue, 30 May 2023 14:48:32 +0000 (10:48 -0400)]
Merge pull request #13414 from LabNConsulting/chopps/no-mgmtd-nowrite-on-off

rework messaging, resource handling in mgmtd with bug fix and code hardening

23 months agozebra: use ifindex vs ifp to avoid use-after-free on shutdown 13414/head
Christian Hopps [Tue, 30 May 2023 00:29:33 +0000 (20:29 -0400)]
zebra: use ifindex vs ifp to avoid use-after-free on shutdown

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agozebra: avoid unneeded vxlan work on shutdown
Christian Hopps [Sun, 28 May 2023 15:31:23 +0000 (11:31 -0400)]
zebra: avoid unneeded vxlan work on shutdown

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agotests: add unified config tests
Christian Hopps [Sun, 28 May 2023 08:33:18 +0000 (04:33 -0400)]
tests: add unified config tests

- simple unified test
- unified test with late backend startup test

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agomgmtd: address review comments
Christian Hopps [Tue, 23 May 2023 12:35:56 +0000 (08:35 -0400)]
mgmtd: address review comments

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agomgmtd: fix clang uninit warning
Christian Hopps [Sat, 20 May 2023 18:55:31 +0000 (14:55 -0400)]
mgmtd: fix clang uninit warning

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agotests: add some more mgmtd tests
Christian Hopps [Sat, 20 May 2023 14:49:08 +0000 (10:49 -0400)]
tests: add some more mgmtd tests

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agomgmtd: cleanup BE xpath subscription and matching code
Christian Hopps [Sat, 20 May 2023 08:25:47 +0000 (04:25 -0400)]
mgmtd: cleanup BE xpath subscription and matching code

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agolib: mgmtd: fix memleaks
Christian Hopps [Sat, 20 May 2023 03:12:33 +0000 (23:12 -0400)]
lib: mgmtd: fix memleaks

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agolib: mgmtd: add manual vty server start option and use it
Christian Hopps [Fri, 19 May 2023 08:25:57 +0000 (04:25 -0400)]
lib: mgmtd: add manual vty server start option and use it

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agolib: mgmtd: fixes for startup config file processing
Christian Hopps [Fri, 19 May 2023 05:29:40 +0000 (01:29 -0400)]
lib: mgmtd: fixes for startup config file processing

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agomgmtd: Add note to SETCFG_REQ and debug logging
Christian Hopps [Tue, 16 May 2023 12:23:09 +0000 (08:23 -0400)]
mgmtd: Add note to SETCFG_REQ and debug logging

- convert impossible situation into assert

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agomgmtd: simplify early config build removing unused code
Christian Hopps [Tue, 16 May 2023 09:54:05 +0000 (05:54 -0400)]
mgmtd: simplify early config build removing unused code

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agomgmtd: fix reading of config file[s]
Christian Hopps [Tue, 9 May 2023 13:19:24 +0000 (09:19 -0400)]
mgmtd: fix reading of config file[s]

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agolib, zebra: Ensure that the ifp->node exists 13631/head
Donald Sharp [Sun, 28 May 2023 14:13:16 +0000 (10:13 -0400)]
lib, zebra: Ensure that the ifp->node exists

On removal, ensure that the ifp->node is set to a null
pointer so that FRR does not use data after freed.
In addition ensure that the ifp->node exists before
attempting to free it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
23 months agopimd: When doing json output do not output non-json strings
Donald Sharp [Sun, 28 May 2023 11:18:36 +0000 (07:18 -0400)]
pimd: When doing json output do not output non-json strings

When entering some show commands that use json in pimd
when the interface cannot be found do not output non-json
format in that case.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
23 months agotests: Allow ping to run multiple times before failing
Donald Sharp [Sat, 27 May 2023 12:50:01 +0000 (08:50 -0400)]
tests: Allow ping to run multiple times before failing

the bgp_default_originate test brings up the topology and
then immediately pings.  Which sometimes fails.  This is
of course possible since the first ping might actually fail
due to arp going on.  So let's give it a second chance or two.
Especially since the test, at this point, is just installing
a default route.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
23 months agoMerge pull request #13602 from opensourcerouting/fix/reuse_subgroup_process_announce_...
Donald Sharp [Sun, 28 May 2023 11:11:43 +0000 (07:11 -0400)]
Merge pull request #13602 from opensourcerouting/fix/reuse_subgroup_process_announce_selected

bgpd: Refactor subgroup_announce_table() to reuse an existing helpers

23 months agolib: enable short circuit for FE client/adapter connection
Christian Hopps [Sat, 6 May 2023 04:15:49 +0000 (00:15 -0400)]
lib: enable short circuit for FE client/adapter connection

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agostaticd: remove connect notify function, not needed
Christian Hopps [Mon, 15 May 2023 04:13:25 +0000 (00:13 -0400)]
staticd: remove connect notify function, not needed

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agomgmtd: lib: cleanup error and debug messages
Christian Hopps [Mon, 15 May 2023 04:11:46 +0000 (00:11 -0400)]
mgmtd: lib: cleanup error and debug messages

- always use IDs not a mix of IDs and pointers.
- always use PRIu64 not a mix of hex and decimal for IDs

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agomgmtd: lib: move INIT to after client registers
Christian Hopps [Mon, 15 May 2023 04:15:31 +0000 (00:15 -0400)]
mgmtd: lib: move INIT to after client registers

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agomgmtd: send reply to SUBSCR_REQ with success or not
Christian Hopps [Wed, 17 May 2023 21:51:28 +0000 (17:51 -0400)]
mgmtd: send reply to SUBSCR_REQ with success or not

since we don't actually handle xpath subscriptions, reply with fail
if they are requested.

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agolib: add short-circuit operation between same process
Christian Hopps [Sat, 6 May 2023 04:09:46 +0000 (00:09 -0400)]
lib: add short-circuit operation between same process

- Use a socketpair for connection, and direct (no event loop)
message sending and handling.

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agolib: mgmtd: add a identifying tag to the debug message
Christian Hopps [Thu, 4 May 2023 04:52:58 +0000 (00:52 -0400)]
lib: mgmtd: add a identifying tag to the debug message

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agolib: dont be tricky with session_id just make it a session_id
Christian Hopps [Thu, 4 May 2023 03:49:16 +0000 (23:49 -0400)]
lib: dont be tricky with session_id just make it a session_id

- Previously was substituting a pointer to local allocated session for the
session_id returned from the FE adapter. This complexity isn't needed.
- Get rid of "%llu" format and the casts that came with it, instead use PRIu64
and the actual (uint64_t) type.

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agomgmtd: fix cleanup of cleanup in FE adapter code
Christian Hopps [Wed, 3 May 2023 01:43:35 +0000 (21:43 -0400)]
mgmtd: fix cleanup of cleanup in FE adapter code

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agomgmtd: eliminate unused state
Christian Hopps [Tue, 2 May 2023 10:01:31 +0000 (06:01 -0400)]
mgmtd: eliminate unused state

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agomgmtd: cleanup/fix BE adapter deletion code
Christian Hopps [Tue, 2 May 2023 08:46:55 +0000 (04:46 -0400)]
mgmtd: cleanup/fix BE adapter deletion code

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agomgmtd: convert BE/FE adapter to use allocated connections
Christian Hopps [Mon, 1 May 2023 19:24:29 +0000 (15:24 -0400)]
mgmtd: convert BE/FE adapter to use allocated connections

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agolib: mgmtd: add server-side connection code to mgmt_msg
Christian Hopps [Sat, 29 Apr 2023 11:20:18 +0000 (07:20 -0400)]
lib: mgmtd: add server-side connection code to mgmt_msg

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agolib: msg: refactor common connection code from mgmtd
Christian Hopps [Sat, 29 Apr 2023 10:22:37 +0000 (06:22 -0400)]
lib: msg: refactor common connection code from mgmtd

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agolib: mgmt msg: add version to messages
Christian Hopps [Tue, 25 Apr 2023 13:52:15 +0000 (09:52 -0400)]
lib: mgmt msg: add version to messages

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agolib: remove write-on-off, just requeue to the back of the queue
Christian Hopps [Sat, 22 Apr 2023 21:44:22 +0000 (17:44 -0400)]
lib: remove write-on-off, just requeue to the back of the queue

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agotests: python-foo assure foo[0] is on a list not dict_values object
Christian Hopps [Fri, 19 May 2023 13:43:06 +0000 (09:43 -0400)]
tests: python-foo assure foo[0] is on a list not dict_values object

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agoMerge pull request #13611 from donaldsharp/logger_warn
Donatas Abraitis [Sat, 27 May 2023 17:05:50 +0000 (20:05 +0300)]
Merge pull request #13611 from donaldsharp/logger_warn

tests: Convert to using logger.warning

23 months agoMerge pull request #13608 from donaldsharp/pam_wrong
Donatas Abraitis [Sat, 27 May 2023 12:35:25 +0000 (15:35 +0300)]
Merge pull request #13608 from donaldsharp/pam_wrong

vtysh: Give actual pam error messages

23 months agotests: Convert to using logger.warning 13611/head
Donald Sharp [Fri, 26 May 2023 20:00:42 +0000 (16:00 -0400)]
tests: Convert to using logger.warning

Use the non deprecated format.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
23 months agoMerge pull request #13607 from LabNConsulting/chopps/fixospftest
Donald Sharp [Fri, 26 May 2023 19:09:38 +0000 (15:09 -0400)]
Merge pull request #13607 from LabNConsulting/chopps/fixospftest

tests: ospfapi: fix non-determinism in test

23 months agovtysh: Give actual pam error messages 13608/head
Donald Sharp [Fri, 26 May 2023 11:44:11 +0000 (07:44 -0400)]
vtysh: Give actual pam error messages

Code was was written where the pam error message put out
was the result from a previous call to the pam modules
instead of the current call to the pam module.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
23 months agoMerge pull request #13599 from LabNConsulting/chopps/analyze-search
Donald Sharp [Fri, 26 May 2023 11:20:17 +0000 (07:20 -0400)]
Merge pull request #13599 from LabNConsulting/chopps/analyze-search

tests: allow selecting test results by regexp match

23 months agotests: selecting results by regexp and ragnes, add container support 13599/head
Christian Hopps [Thu, 25 May 2023 09:01:37 +0000 (05:01 -0400)]
tests: selecting results by regexp and ragnes, add container support

- Allow selecting results using a regexp
- Allow selecting results using commasep range specs
- Add support for getting and saving results from a docker/podman
  container.
- update docs

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agoMerge pull request #13594 from LabNConsulting/chopps/uniconfig
Donatas Abraitis [Fri, 26 May 2023 10:16:06 +0000 (13:16 +0300)]
Merge pull request #13594 from LabNConsulting/chopps/uniconfig

tests: cleanup unified config and config arg

23 months agotests: ospfapi: fix non-determinism in test 13607/head
Christian Hopps [Fri, 26 May 2023 08:57:00 +0000 (04:57 -0400)]
tests: ospfapi: fix non-determinism in test

fixes #13584

The test had the ospf client injecting multiple opaque LSAs on 5s pace,
but the test itself verified and advanced on an LSA in the middle of
that sequence and not the last one. Then the test reset the ospf client
and originating router. If a later injected LSA managed to get in to the
router and flooded prior to the client/router reset then the opaque data
or sequence number could differ from the expected value.

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agotests: cleanup the config file specification and default code 13594/head
Christian Hopps [Wed, 24 May 2023 08:43:09 +0000 (04:43 -0400)]
tests: cleanup the config file specification and default code

Also, add a new warning for missing configuration files when user is
expecting them.

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agoMerge pull request #13598 from opensourcerouting/fix/typo_vtysh
Igor Ryzhov [Thu, 25 May 2023 14:09:41 +0000 (17:09 +0300)]
Merge pull request #13598 from opensourcerouting/fix/typo_vtysh

vtysh: Fix typo in warning message for `-b -f ...`

23 months agobgpd: Refactor subgroup_announce_table() to reuse an existing helpers 13602/head
Donatas Abraitis [Thu, 25 May 2023 12:46:21 +0000 (15:46 +0300)]
bgpd: Refactor subgroup_announce_table() to reuse an existing helpers

Reuse subgroup_process_announce_selected(). It does the same as we do here
duplicating the logic.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
23 months agoripd: embed BFD YANG models 13601/head
David Lamparter [Thu, 25 May 2023 11:47:03 +0000 (13:47 +0200)]
ripd: embed BFD YANG models

The frr-ripd model has a dependency on frr-bfdd, so include it in build.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
23 months agomgmtd: embed necessary YANG models
David Lamparter [Thu, 25 May 2023 11:45:08 +0000 (13:45 +0200)]
mgmtd: embed necessary YANG models

Listing `.c` files in `$(…_OBJECTS):` does not have the desired effect.

(Also CLEANFILES is not needed, yang/subdir.am already has yang/*.c in
CLEANFILES anyway.)

Fixes: #13600
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
23 months agovtysh: Fix typo in warning message for `-b -f ...` 13598/head
Donatas Abraitis [Thu, 25 May 2023 07:20:29 +0000 (10:20 +0300)]
vtysh: Fix typo in warning message for `-b -f ...`

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
23 months agoMerge pull request #13592 from LabNConsulting/chopps/newmunet
Quentin Young [Wed, 24 May 2023 16:20:41 +0000 (12:20 -0400)]
Merge pull request #13592 from LabNConsulting/chopps/newmunet

munet: import 0.13.5 w/ nicer cmd logging

23 months agomunet: import 0.13.5 w/ nicer cmd logging 13592/head
Christian Hopps [Wed, 24 May 2023 06:46:58 +0000 (02:46 -0400)]
munet: import 0.13.5 w/ nicer cmd logging

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agoldpd: changes for code maintainability 13588/head
sri-mohan1 [Tue, 23 May 2023 17:50:01 +0000 (23:20 +0530)]
ldpd: changes for code maintainability

these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
23 months agoMerge pull request #13555 from LabNConsulting/aceelindem/ospf-p2mp-delayed-reflooding...
Russ White [Tue, 23 May 2023 15:41:35 +0000 (11:41 -0400)]
Merge pull request #13555 from LabNConsulting/aceelindem/ospf-p2mp-delayed-reflooding-config

ospfd: OSPF P2MP Delayed Reflooding configuration

23 months agoMerge pull request #13586 from ponedo/link-state-doc-fix
Donald Sharp [Tue, 23 May 2023 14:57:20 +0000 (10:57 -0400)]
Merge pull request #13586 from ponedo/link-state-doc-fix

doc: fix typo RFC7572 to RFC7752

23 months agodoc: fix typo RFC7572 to RFC7752 13586/head
ponedo [Tue, 23 May 2023 14:52:51 +0000 (22:52 +0800)]
doc: fix typo RFC7572 to RFC7752

Signed-off-by: ponedo <2534164734@qq.com>
23 months agoMerge pull request #13548 from opensourcerouting/fix/use_min_value_of_cli_zebra_cap_ecmp
Russ White [Tue, 23 May 2023 12:25:46 +0000 (08:25 -0400)]
Merge pull request #13548 from opensourcerouting/fix/use_min_value_of_cli_zebra_cap_ecmp

ripd: Make sure we do not overuse higher values for ECMP count

23 months agoMerge pull request #13556 from donaldsharp/token_to_desc
Russ White [Tue, 23 May 2023 12:21:51 +0000 (08:21 -0400)]
Merge pull request #13556 from donaldsharp/token_to_desc

memory desciprtion shortening

23 months agoMerge pull request #13578 from opensourcerouting/fix/ripd_argv_find
Russ White [Tue, 23 May 2023 12:20:07 +0000 (08:20 -0400)]
Merge pull request #13578 from opensourcerouting/fix/ripd_argv_find

ripd: Use argv_find to avoid buffer overflow when parsing allow-ecmp args

23 months agoMerge pull request #13535 from opensourcerouting/feature/ripng_allow_ecmp
Russ White [Tue, 23 May 2023 11:35:32 +0000 (07:35 -0400)]
Merge pull request #13535 from opensourcerouting/feature/ripng_allow_ecmp

ripng: Implement allow-ecmp X command

23 months agoMerge pull request #13577 from raja-rajasekar/frr_dev1
Donatas Abraitis [Tue, 23 May 2023 07:40:46 +0000 (10:40 +0300)]
Merge pull request #13577 from raja-rajasekar/frr_dev1

Fixing show bgp all json format and convert evpn to no pretty output

23 months agoMerge pull request #13570 from donaldsharp/toooooooo_fast
Donatas Abraitis [Tue, 23 May 2023 06:44:13 +0000 (09:44 +0300)]
Merge pull request #13570 from donaldsharp/toooooooo_fast

Grab bag of fixes from upgrading system

23 months agoripngd: Make sure we do not overuse higher values for ECMP count 13535/head
Donatas Abraitis [Wed, 17 May 2023 19:17:02 +0000 (22:17 +0300)]
ripngd: Make sure we do not overuse higher values for ECMP count

Use a minimum value of a CLI version and a value of Zebra capabilities.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
23 months agodoc: Add RIPng allow-ecmp command
Donatas Abraitis [Tue, 16 May 2023 07:30:20 +0000 (10:30 +0300)]
doc: Add RIPng allow-ecmp command

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
23 months agotests: Check if `allow-ecmp` command works for RIPng
Donatas Abraitis [Tue, 16 May 2023 07:28:35 +0000 (10:28 +0300)]
tests: Check if `allow-ecmp` command works for RIPng

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
23 months agoripng: Implement `allow-ecmp X` command
Donatas Abraitis [Tue, 16 May 2023 07:34:22 +0000 (10:34 +0300)]
ripng: Implement `allow-ecmp X` command

A port of ripd implementation for ripngd implemented by 75fce4645a7cf0a93ef0109d69365f51b84bc47c.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
23 months agoripd: Use argv_find to avoid buffer overflow when parsing allow-ecmp args 13578/head
Donatas Abraitis [Tue, 23 May 2023 06:20:27 +0000 (09:20 +0300)]
ripd: Use argv_find to avoid buffer overflow when parsing allow-ecmp args

==13211==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6020000af158 at pc 0x55d48c5f1e38 bp 0x7fffd8a713d0 sp 0x7fffd8a713c0
READ of size 8 at 0x6020000af158 thread T0
    #0 0x55d48c5f1e37 in rip_allow_ecmp ripd/rip_cli.c:98
    #1 0x7f2ec125aa0f in cmd_execute_command_real lib/command.c:990
    #2 0x7f2ec125ae90 in cmd_execute_command lib/command.c:1049
    #3 0x7f2ec125b406 in cmd_execute lib/command.c:1217
    #4 0x7f2ec137ca36 in vty_command lib/vty.c:551
    #5 0x7f2ec137ce52 in vty_execute lib/vty.c:1314
    #6 0x7f2ec1384f9e in vtysh_read lib/vty.c:2223
    #7 0x7f2ec137041b in event_call lib/event.c:1995
    #8 0x7f2ec12b54bf in frr_run lib/libfrr.c:1204
    #9 0x55d48c5f0f32 in main ripd/rip_main.c:171
    #10 0x7f2ec0ad9c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
    #11 0x55d48c5f1349 in _start (/usr/lib/frr/ripd+0x3b349)

0x6020000af158 is located 0 bytes to the right of 8-byte region [0x6020000af150,0x6020000af158)
allocated by thread T0 here:
    #0 0x7f2ec18ccb40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x7f2ec12d2e41 in qmalloc lib/memory.c:100
    #2 0x7f2ec125a815 in cmd_execute_command_real lib/command.c:955
    #3 0x7f2ec125ae90 in cmd_execute_command lib/command.c:1049
    #4 0x7f2ec125b406 in cmd_execute lib/command.c:1217
    #5 0x7f2ec137ca36 in vty_command lib/vty.c:551
    #6 0x7f2ec137ce52 in vty_execute lib/vty.c:1314
    #7 0x7f2ec1384f9e in vtysh_read lib/vty.c:2223
    #8 0x7f2ec137041b in event_call lib/event.c:1995
    #9 0x7f2ec12b54bf in frr_run lib/libfrr.c:1204
    #10 0x55d48c5f0f32 in main ripd/rip_main.c:171
    #11 0x7f2ec0ad9c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

SUMMARY: AddressSanitizer: heap-buffer-overflow ripd/rip_cli.c:98 in rip_allow_ecmp
Shadow bytes around the buggy address:
  0x0c048000ddd0: fa fa fd fa fa fa fd fa fa fa fd fd fa fa fd fa
  0x0c048000dde0: fa fa fd fa fa fa fd fd fa fa fd fa fa fa fd fd
  0x0c048000ddf0: fa fa fd fa fa fa fd fd fa fa fd fd fa fa fd fd
  0x0c048000de00: fa fa fd fa fa fa fd fd fa fa 00 03 fa fa fd fa
  0x0c048000de10: fa fa fd fa fa fa 00 00 fa fa fd fa fa fa 00 03
=>0x0c048000de20: fa fa 00 03 fa fa fd fa fa fa 00[fa]fa fa fa fa
  0x0c048000de30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c048000de40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c048000de50: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c048000de60: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c048000de70: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==13211==ABORTING

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
23 months agobgpd: Using no pretty json output for l2vpn-Evpn routes 13577/head
Rajasekar Raja [Mon, 22 May 2023 21:14:30 +0000 (14:14 -0700)]
bgpd: Using no pretty json output for l2vpn-Evpn routes

The output of show bgp all json is inconsistent across Address-families
i.e. ipv4/ipv6 is a no pretty format while l2vpn-evpn is in a pretty
format. For huge scale (lots of routes with lots of paths), it is better
to use no_pretty format.

Before fix:
torm-11# sh bgp all json
{
"ipv4Unicast":{
 "vrfId": 0,
 "vrfName": "default",
 "tableVersion": 1,
 "routerId": "27.0.0.15",
 "defaultLocPrf": 100,
 "localAS": 65000,
 "routes": { } }
,
"l2VpnEvpn":{
"routes":{
  "27.0.0.15:2":{
    "rd":"27.0.0.15:2",
    "[1]:[0]:[03:44:38:39:ff:ff:01:00:00:01]:[128]:[::]:[0]":{
      "prefix":"[1]:[0]:[03:44:38:39:ff:ff:01:00:00:01]:[128]:[::]:[0]",
      "prefixLen":352,
      "paths":[
<SNIP>.............

After fix:
torm-11# sh bgp all json
{
"ipv4Unicast":{
 "vrfId": 0,
 "vrfName": "default",
 "tableVersion": 1,
 "routerId": "27.0.0.15",
 "defaultLocPrf": 100,
 "localAS": 65000,
 "routes": { } }
,
"l2VpnEvpn":{
"routes":{"27.0.0.15:2":{"rd":"27.0.0.15:2","[1]:[0]:[03:44:38:39:ff:ff:01:00:00:01]:[128]:[::]:[0]":{"prefix":"[1]:[0]:[03:44:38:39:ff:ff:01:00:00:01]:[128]:[::]:[0]","prefixLen":352,"paths":[[{"valid":true,"bestpath":true,"selectionReason":"First path received","pathFrom":"external","routeType":1,"weight":32768,"peerId":"(unspec)","path":"","origin":"IGP","extendedCommunity"
<SNIP>.............

Issue: 3472865

Ticket:#3472865

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
23 months agobgpd: Fix the json output of show bgp all json to be in a valid format
Rajasekar Raja [Mon, 22 May 2023 20:08:34 +0000 (13:08 -0700)]
bgpd: Fix the json output of show bgp all json to be in a valid format

In the json output of show bgp all json, the l2VpnEvpn afi-safi is
missing the 'routes' key making the json output format invalid.

Before Fix:
torm-11# sh bgp all json
{
<SNIP>....................
"l2VpnEvpn":{
{
  "27.0.0.15:2":{
    "rd":"27.0.0.15:2",
    "[4]:[03:44:38:39:ff:ff:01:00:00:01]:[32]:[27.0.0.15]":{
      "prefix":"[4]:[03:44:38:39:ff:ff:01:00:00:01]:[32]:[27.0.0.15]",
      "prefixLen":352,
      "paths":[
<SNIP>....................

After Fix:
torm-11# sh bgp all json
{
<SNIP>....................
"l2VpnEvpn":{
"routes":{
  "27.0.0.15:2":{
    "rd":"27.0.0.15:2",
    "[1]:[0]:[03:44:38:39:ff:ff:01:00:00:01]:[128]:[::]:[0]":{
      "prefix":"[1]:[0]:[03:44:38:39:ff:ff:01:00:00:01]:[128]:[::]:[0]",
      "prefixLen":352,
      "paths":[

Issue: 3472865
Ticket:#3472865

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
23 months agoospfd: OSPF P2MP Delayed Reflooding configuration 13555/head
Acee [Thu, 18 May 2023 14:43:52 +0000 (10:43 -0400)]
ospfd: OSPF P2MP Delayed Reflooding configuration

Currently, delayed reflooding on P2MP interfaces for LSAs received
from neighbors on the interface is unconditionally (see commit
c706f0e32ba8aa8780a0618b6fbba364c383ae05). In some cases, this
change wasn't desirable and this feature makes delayed reflooding
configurable for P2MP interfaces via the CLI command:
"ip ospf network point-to-multipoint delay-reflood" in interface
submode.

Signed-off-by: Acee <aceelindem@gmail.com>
23 months agolib: va_end must be called 13570/head
Donald Sharp [Sun, 21 May 2023 23:59:41 +0000 (19:59 -0400)]
lib: va_end must be called

According to the man page a va_start must be followed by
a va_end before the end of the function.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
23 months agozebra: Fix paths that have already de-refed ctx
Donald Sharp [Sun, 21 May 2023 23:55:20 +0000 (19:55 -0400)]
zebra: Fix paths that have already de-refed ctx

There is no path in some functions where the ctx
has not already been de-refed.  As such no need
to test for it's existence.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
23 months agotests: Do not Cause test scripts to stop running when config load fails
Donald Sharp [Sun, 21 May 2023 23:39:39 +0000 (19:39 -0400)]
tests: Do not Cause test scripts to stop running when config load fails

When running the pytests in parallel, calling pytest.exit() causes
the entire test run to be aborted.  Which.... Is frankly not cool.
Let's notice the failure and move on to the next tests.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
23 months agotests: Add `exit` stanzas to pre-generated config
Donald Sharp [Mon, 22 May 2023 12:25:38 +0000 (08:25 -0400)]
tests: Add `exit` stanzas to pre-generated config

A bunch of tests rely on pre-generated config from
json files.  These tests were not putting `exit` stanzas
and a bunch of the tests as a result are silently failing
to configure properly at all, as commands were being sent
to the wrong daemons.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
23 months agotests: Slow bgp_default_originate test down slightly
Donald Sharp [Fri, 19 May 2023 20:03:57 +0000 (16:03 -0400)]
tests: Slow bgp_default_originate test down slightly

The test is performing these steps:

a) get timestamp of route installed in zebra
b) <make changes>
c) get new timestamp of route installed in zebra

If < 1 second happens between A and C the test
assumes that something went wrong, as that it is
testing to see if the route was reinstalled <yes I know>.

Just sleep 1 second after a) happens so that if a reinstall
happens we can easily see it, and we also know that if a
reinstall doesn't happen then the new timestamp will
always be 1 second or greater.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
23 months agoMerge pull request #13560 from donaldsharp/fpm_netlink_aroni
David Lamparter [Mon, 22 May 2023 13:46:29 +0000 (15:46 +0200)]
Merge pull request #13560 from donaldsharp/fpm_netlink_aroni

23 months agoMerge pull request #13506 from anlancs/fix/bfdd-vrf-check
Igor Ryzhov [Mon, 22 May 2023 11:24:34 +0000 (14:24 +0300)]
Merge pull request #13506 from anlancs/fix/bfdd-vrf-check

bfdd: Fix malformed session with vrf

23 months agoMerge pull request #13564 from chiragshah6/fdev1
Donatas Abraitis [Mon, 22 May 2023 06:45:54 +0000 (09:45 +0300)]
Merge pull request #13564 from chiragshah6/fdev1

 bgpd: aggregate route best path select and other fixes

23 months agoMerge pull request #13563 from donaldsharp/remove_true
Donatas Abraitis [Mon, 22 May 2023 06:38:53 +0000 (09:38 +0300)]
Merge pull request #13563 from donaldsharp/remove_true

tests: pytest does not like return True from a test

23 months agoMerge pull request #13566 from LabNConsulting/chopps/analyze-improvement
Donald Sharp [Mon, 22 May 2023 00:22:22 +0000 (20:22 -0400)]
Merge pull request #13566 from LabNConsulting/chopps/analyze-improvement

tests: have ananlyze.py `chown -R $SUDO_USER` when copying results

23 months agoMerge pull request #13568 from opensourcerouting/fix/timers_bgp_topotests
Donald Sharp [Mon, 22 May 2023 00:21:51 +0000 (20:21 -0400)]
Merge pull request #13568 from opensourcerouting/fix/timers_bgp_topotests

tests: Fix timers command for bgp_disable_addpath_rx test

23 months agoMerge pull request #13567 from opensourcerouting/fix/initialize_buf_char_for_path_inf...
Donald Sharp [Mon, 22 May 2023 00:21:21 +0000 (20:21 -0400)]
Merge pull request #13567 from opensourcerouting/fix/initialize_buf_char_for_path_info_cmp

bgpd: Initialize pfx_buf to zeros before using in bgp_path_info_cmp()

23 months agoMerge pull request #13565 from LabNConsulting/chopps/munet-update
Igor Ryzhov [Sat, 20 May 2023 11:11:05 +0000 (14:11 +0300)]
Merge pull request #13565 from LabNConsulting/chopps/munet-update

23 months agotests: Fix timers command for bgp_disable_addpath_rx test 13568/head
Donatas Abraitis [Sat, 20 May 2023 07:06:49 +0000 (10:06 +0300)]
tests: Fix timers command for bgp_disable_addpath_rx test

Was incorrectly setting BGP timers.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
23 months agobgpd: Initialize pfx_buf to zeros before using in bgp_path_info_cmp() 13567/head
Donatas Abraitis [Sat, 20 May 2023 07:03:10 +0000 (10:03 +0300)]
bgpd: Initialize pfx_buf to zeros before using in bgp_path_info_cmp()

This can lead into some garbage outputs, that can't be decoded in utf-8 or so.

This was catched when testing 76b246aa1f779e17ce6845c6ab0c292497b0008f.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
23 months agotests: munet to version 0.13.4 13565/head
Christian Hopps [Sat, 20 May 2023 03:16:39 +0000 (23:16 -0400)]
tests: munet to version 0.13.4

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agotests: have ananlyze.py `chown -R $SUDO_USER` when copying results 13566/head
Christian Hopps [Sat, 20 May 2023 03:14:18 +0000 (23:14 -0400)]
tests: have ananlyze.py `chown -R $SUDO_USER` when copying results

Signed-off-by: Christian Hopps <chopps@labn.net>
23 months agobfdd: Use shorter memory names so that they fit in vty output 13556/head
Donald Sharp [Thu, 18 May 2023 15:15:58 +0000 (11:15 -0400)]
bfdd: Use shorter memory names so that they fit in vty output

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