]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
10 months agoMerge pull request #13649 from donaldsharp/unlock_the_node_or_else master
Donatas Abraitis [Tue, 6 Jun 2023 05:52:40 +0000 (08:52 +0300)]
Merge pull request #13649 from donaldsharp/unlock_the_node_or_else

zebra: Unlock the route node when sending route notifications

10 months agoMerge pull request #13689 from sri-mohan1/srib-ldpd1
Donatas Abraitis [Tue, 6 Jun 2023 05:43:36 +0000 (08:43 +0300)]
Merge pull request #13689 from sri-mohan1/srib-ldpd1

ldpd: changes for code maintainability

10 months agoMerge pull request #13670 from donaldsharp/coverity_99
Donatas Abraitis [Mon, 5 Jun 2023 19:33:55 +0000 (22:33 +0300)]
Merge pull request #13670 from donaldsharp/coverity_99

Coverity 99

10 months agoldpd: changes for code maintainability
sri-mohan1 [Mon, 5 Jun 2023 19:09:42 +0000 (00:39 +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>
10 months agoMerge pull request #13658 from louis-6wind/fix-flex-algo2
Donald Sharp [Mon, 5 Jun 2023 16:43:01 +0000 (12:43 -0400)]
Merge pull request #13658 from louis-6wind/fix-flex-algo2

isisd: fix wrongly disabled flex-algorithm

10 months agoMerge pull request #13685 from sri-mohan1/srib-ldpd1
Donald Sharp [Mon, 5 Jun 2023 14:52:46 +0000 (10:52 -0400)]
Merge pull request #13685 from sri-mohan1/srib-ldpd1

ldpd: changes for code maintainability

10 months agomgmtd: Fix up some coverity issues
Donald Sharp [Fri, 2 Jun 2023 19:09:29 +0000 (15:09 -0400)]
mgmtd: Fix up some coverity issues

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
10 months agobgpd: entry->any is never true
Donald Sharp [Fri, 2 Jun 2023 19:04:38 +0000 (15:04 -0400)]
bgpd: entry->any is never true

The only places entry->any could ever be set to true was
when str was NULL.  Unfortunately with the way our CLI works
str is impossible to be NonNULL.  The entry->any value *used*
to work prior to commit e961923c7217b935027107cad30c35c3907c936f
but it was changed back in 2016 and no-one has noticed the changed
ability.

Let's just admit that there are no users of this and remove this
dead code.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
10 months agotests: Rename a test to test_bgp_gr_functionality_topo3.py
Donald Sharp [Fri, 2 Jun 2023 18:01:12 +0000 (14:01 -0400)]
tests: Rename a test to test_bgp_gr_functionality_topo3.py

Since the test was not named test_bgp_gr_functionality_topo3.py
pytest was not picking it up to run.  Let's run it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
10 months agoMerge pull request #13684 from LabNConsulting/chopps/pause-functionality
Donald Sharp [Mon, 5 Jun 2023 11:53:54 +0000 (07:53 -0400)]
Merge pull request #13684 from LabNConsulting/chopps/pause-functionality

tests: pause (with CLI) at step() functions when run with --pause

10 months agoMerge pull request #13681 from LabNConsulting/chopps/bad-abstract2
Donald Sharp [Mon, 5 Jun 2023 11:53:31 +0000 (07:53 -0400)]
Merge pull request #13681 from LabNConsulting/chopps/bad-abstract2

lib: mgmtd: remove backend abstraction layer and other cleanup

10 months agoMerge pull request #13677 from LabNConsulting/chopps/bad-abstract
Donald Sharp [Mon, 5 Jun 2023 11:51:25 +0000 (07:51 -0400)]
Merge pull request #13677 from LabNConsulting/chopps/bad-abstract

lib: mgmtd: remove obfuscating abstraction layer and other cleanup

10 months agoldpd: changes for code maintainability
sri-mohan1 [Mon, 5 Jun 2023 05:21:01 +0000 (10:51 +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>
10 months agotests: pause (with CLI) at step() functions when run with --pause
Christian Hopps [Sun, 4 Jun 2023 21:36:56 +0000 (17:36 -0400)]
tests: pause (with CLI) at step() functions when run with --pause

Signed-off-by: Christian Hopps <chopps@labn.net>
10 months agolib: mgmtd: remove abstraction layer and other cleanup
Christian Hopps [Sun, 4 Jun 2023 19:43:22 +0000 (15:43 -0400)]
lib: mgmtd: remove abstraction layer and other cleanup

Code is no longer using a global FE "client context", and instead
creates client objects, rename the structure and it's uses to reflect this.

Remove an obfuscating abstraction layer whose existence was entirely
based on using a uintptr_t rather than a pointer to an declared-only struct.

Change multi-duty "params" structure into a single duty callbacks one.

Remove unsupported API code.

Signed-off-by: Christian Hopps <chopps@labn.net>
10 months agolib: mgmtd: remove obfuscating abstraction layer and other cleanup
Christian Hopps [Sun, 4 Jun 2023 13:24:03 +0000 (09:24 -0400)]
lib: mgmtd: remove obfuscating abstraction layer and other cleanup

Remove an obfuscating abstraction layer whose existence was entirely
based on using a uintptr_t rather than a pointer to an declared-only struct.

As the code is no longer using a global FE "client context", and instead
create client objects, rename the structure and it's uses to reflect this.

Change init "params" structure into a single use callbacks one.

Signed-off-by: Christian Hopps <chopps@labn.net>
10 months agoMerge pull request #13656 from sri-mohan1/srib-ldpd1
Donatas Abraitis [Sun, 4 Jun 2023 19:37:04 +0000 (22:37 +0300)]
Merge pull request #13656 from sri-mohan1/srib-ldpd1

ldpd: changes for code maintainability

10 months agoMerge pull request #13668 from donaldsharp/fsm_more_descriptive
Donatas Abraitis [Sun, 4 Jun 2023 19:36:43 +0000 (22:36 +0300)]
Merge pull request #13668 from donaldsharp/fsm_more_descriptive

bgpd: Give more data when state machine fails to change state

10 months agobgpd: Give more data when state machine fails to change state
Donald Sharp [Fri, 2 Jun 2023 15:02:54 +0000 (11:02 -0400)]
bgpd: Give more data when state machine fails to change state

When a state machine transition fails, bgpd would output
data about what happened, but not necessarily give the
reason why.  Add that data to the output.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
10 months agoMerge pull request #13659 from donaldsharp/increase_mgmt_time
Donatas Abraitis [Fri, 2 Jun 2023 06:50:28 +0000 (09:50 +0300)]
Merge pull request #13659 from donaldsharp/increase_mgmt_time

tests: new mgmt_startup tests are failing due to insufficient time

10 months agoMerge pull request #13646 from donaldsharp/logically_illogical
Donatas Abraitis [Fri, 2 Jun 2023 06:19:04 +0000 (09:19 +0300)]
Merge pull request #13646 from donaldsharp/logically_illogical

mgmtd: xpath is already NULL in the failure path

10 months agoMerge pull request #13641 from donaldsharp/com_list_str
mobash-rasool [Fri, 2 Jun 2023 02:44:10 +0000 (08:14 +0530)]
Merge pull request #13641 from donaldsharp/com_list_str

Bunch of code cleanup from Coverity

10 months agoMerge pull request #13660 from anlancs/bgpd-cleanup-12
mobash-rasool [Fri, 2 Jun 2023 02:41:55 +0000 (08:11 +0530)]
Merge pull request #13660 from anlancs/bgpd-cleanup-12

bgpd: Fix typo in debug message

10 months agoMerge pull request #13637 from yyuanam/fix_vtysh_core
Donatas Abraitis [Thu, 1 Jun 2023 19:30:50 +0000 (22:30 +0300)]
Merge pull request #13637 from yyuanam/fix_vtysh_core

lib: fix vtysh core when handling questionmark

10 months agoMerge pull request #13653 from dpward/ospf6d-redundant-lsa
Donatas Abraitis [Thu, 1 Jun 2023 19:24:45 +0000 (22:24 +0300)]
Merge pull request #13653 from dpward/ospf6d-redundant-lsa

ospf6d: Prevent redundant LSA generation before interface goes down

10 months agobgpd: Fix typo in debug message
anlan_cs [Thu, 1 Jun 2023 01:46:51 +0000 (09:46 +0800)]
bgpd: Fix typo in debug message

Cosmetic change for the debug messages, mainly on the parentheses.

Before:
```
[ZJYCS-KQYD6] VRF vrf-debug(140): Rcvd NH update 50.50.50.0/24(0)0) - metric 300/300 #nhops 2/1 flags Valid Reg Static Static Exact
[VZJVD-D7GXM] parse nexthop update(50.50.50.0/24(0)(VRF vrf-debug)): bnc info not found for nexthop cache
[NSWTE-81HEK] parse nexthop update(50.50.201.0/31(0)(VRF vrf-debug)): bnc info not found for import check
```

After:
```
[ZJYCS-KQYD6] VRF vrf-debug(140): Rcvd NH update 50.50.50.0/24(0)(0) - metric 300/300 #nhops 2/1 flags Valid Reg Static Static Exact
[VZJVD-D7GXM] parse nexthop update 50.50.50.0/24(0)(VRF vrf-debug): bnc info not found for nexthop cache
[NSWTE-81HEK] parse nexthop update 50.50.201.0/31(0)(VRF vrf-debug): bnc info not found for import check
```

Signed-off-by: anlan_cs <vic.lan@pica8.com>
10 months agotests: new mgmt_startup tests are failing due to insufficient time
Donald Sharp [Thu, 1 Jun 2023 13:57:48 +0000 (09:57 -0400)]
tests: new mgmt_startup tests are failing due to insufficient time

The tests are failing due to heavily loaded system and insufficient
time for large configs to be handled.  Increasing the time
allows the tests to complete locally for me under heavy load.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
10 months agoeigrpd: dest_addr does not need to be set to NULL
Donald Sharp [Tue, 30 May 2023 23:48:55 +0000 (19:48 -0400)]
eigrpd: dest_addr does not need to be set to NULL

All paths of the loop set dest_addr at the start
of the loop.  No need to set it to NULL to immediately
set it too something else.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
10 months agobgpd: vpn_policy_getafi can return AFI_MAX
Donald Sharp [Tue, 30 May 2023 23:47:32 +0000 (19:47 -0400)]
bgpd: vpn_policy_getafi can return AFI_MAX

Let's account for vpn_policy_getafi having a failure
situation and back out of the whole thing gracefully.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
10 months agobgpd: blnc cannot be NULL at if statement time
Donald Sharp [Tue, 30 May 2023 23:44:36 +0000 (19:44 -0400)]
bgpd: blnc cannot be NULL at if statement time

It is impossible for the blnc statement to ever be NULL at
line 1470 as that the if statement at 1453 guarantees it
to be set to something.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
10 months agozebra: Consolidate the stream_failure section with normal return
Donald Sharp [Tue, 30 May 2023 23:43:24 +0000 (19:43 -0400)]
zebra: Consolidate the stream_failure section with normal return

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
10 months agozebra: No need to set msg to NULL
Donald Sharp [Tue, 30 May 2023 23:40:22 +0000 (19:40 -0400)]
zebra: No need to set msg to NULL

The msg value is always reset to something new before it is used inside
the mutex.  No need to set it to NULL.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
10 months agobgpd: community_list_set str is always non null
Donald Sharp [Tue, 30 May 2023 23:30:12 +0000 (19:30 -0400)]
bgpd: community_list_set str is always non null

When calling community_list_set the str variable is
always non NULL.  As such let's treat it as such.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
10 months agoMerge pull request #13652 from opensourcerouting/fix/drop_old_releases_from_the_table
Donald Sharp [Thu, 1 Jun 2023 12:27:54 +0000 (08:27 -0400)]
Merge pull request #13652 from opensourcerouting/fix/drop_old_releases_from_the_table

doc: Update reference table for current and upcoming release dates

10 months agotests: re-style isis_sr_flex_algo_topo1
Louis Scalbert [Thu, 1 Jun 2023 12:18:47 +0000 (14:18 +0200)]
tests: re-style isis_sr_flex_algo_topo1

Re-style isis_sr_flex_algo_topo1. Cosmetic change.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
10 months agoisisd: fix wrongly disabled flex-algo
Louis Scalbert [Wed, 31 May 2023 14:53:58 +0000 (16:53 +0200)]
isisd: fix wrongly disabled flex-algo

A configured flex-algo algorithm may remain in disabled state after its
definition is advertised on the area.

It happens sometimes that, in isis_sr_flex_algo_topo1 topotest step 4 or
8, flex-algo 203 is disabled. It depends on the following sequence:

 1. Flex-algo 203 is configured on a remote router to be re-advertised.
 2. A LSP is received on the local router and contains the algo 203
    definition.
 3. The local router re-builds its own LSP with lsp_build().
 4. local router isis_run_spf() recomputes the algo 203 SPF tree.

A 1. 2. 3. 4. sequence results in a working test. The reception of the
remote LSP (2.) does not trigger the built of the local LSP. If for
some reasons, the sequence is 1. 3. 4. 2. 4., isis_run_spf() will not
knows that flex-algo 203 has been re-enabled because
flex_algo_get_state() only returns the state from the local LSP.

Compare in sequence step 4. the flex-algo state from the local LSP with
the actual state. If the state is not the same, request a new local LSP
generation and quits the re-computation of algo SPF tree. The SPF tree
will be recomputed just after the built of the local LSP.

Fixes: 3f55b8c621 ("isisd: fix disabled flex-algo on race condition")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
10 months agotests: fix mpls table check in isis_sr_flex_algo_topo1
Louis Scalbert [Thu, 1 Jun 2023 09:39:30 +0000 (11:39 +0200)]
tests: fix mpls table check in isis_sr_flex_algo_topo1

Some test steps result in removing some entries in the MPLS forwarding
table. However, these steps pass before the entries are actually
removed.

Use the exact JSON comparison so that the removal of the entries is
checked.

Fixes: 1a61ef95b2 ("tests: add isis_sr_flex_algo_topo1 for flex-algo")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
10 months agozebra: Unlock the route node when sending route notifications
Donald Sharp [Wed, 31 May 2023 15:40:07 +0000 (11:40 -0400)]
zebra: Unlock the route node when sending route notifications

When using a context to send route notifications to upper
level protocols, the code was using a locking function to
get the route node.  There is no need for this to be locked
as such FRR should free it up.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
10 months agoldpd: changes for code maintainability
sri-mohan1 [Thu, 1 Jun 2023 07:27:14 +0000 (12:57 +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>
10 months agoMerge pull request #13450 from patrasar/mld_core
Donatas Abraitis [Thu, 1 Jun 2023 06:13:30 +0000 (09:13 +0300)]
Merge pull request #13450 from patrasar/mld_core

pim6d: Fix crash in ipv6 pim command

10 months agoospf6d: Prevent redundant LSA generation before interface goes down
David Ward [Wed, 31 May 2023 20:44:44 +0000 (16:44 -0400)]
ospf6d: Prevent redundant LSA generation before interface goes down

Commit 76249532faad ("ospf6d: Handle Premature Aging of LSAs") added a
duplicate call to OSPF6_INTRA_PREFIX_LSA_EXECUTE_TRANSIT(), when the
interface state changes to "Down".

Fixes: #1738
Signed-off-by: David Ward <david.ward@ll.mit.edu>
10 months agolib: fix vtysh core when handling questionmark
Yuan Yuan [Tue, 30 May 2023 19:20:09 +0000 (19:20 +0000)]
lib: fix vtysh core when handling questionmark

When issue vtysh command with ?, the initial buf size for the
element is 16. Then it would loop through each element in the cmd
output vector. If the required size for printing out the next
element is larger than the current buf size, realloc the buf memory
by doubling the current buf size regardless of the actual size
that's needed. This would cause vtysh core when the doubled size
is not enough for the next element.

Signed-off-by: Yuan Yuan <yyuanam@amazon.com>
10 months agodoc: Update reference table for current and upcoming release dates
Donatas Abraitis [Wed, 31 May 2023 20:08:57 +0000 (23:08 +0300)]
doc: Update reference table for current and upcoming release dates

Keep only 3 release dates, current and two upcoming. On the next release,
just update one, instead of multiple (zero point looking too much in the
future).

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
10 months agomgmtd: xpath is already NULL in the failure path
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>
10 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

10 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

10 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

10 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

10 months agobgpd: fix bgpd core when unintern attr
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>
10 months agoospfd, ospf6d: fix time_t truncation
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>
10 months agotests: Actually loop if ping fails
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>
10 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

10 months agomgmtd: fix possible race btw read config and backend connection
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>
10 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

10 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

10 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

10 months agozebra: use ifindex vs ifp to avoid use-after-free on shutdown
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>
10 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>
10 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>
10 months agopim6d: Fix crash in ipv6 pim command
Sarita Patra [Fri, 5 May 2023 17:52:33 +0000 (10:52 -0700)]
pim6d: Fix crash in ipv6 pim command

Problem:
Execute the below commands, pim6d core happens.
interface ens193
 ip address 69.0.0.2/24
 ipv6 address 8000::1/120
 ipv6 mld
 ipv6 pim
We see crash only if the interface is not configured, and
we are executing PIM/MLD commands.

RootCause:
Interface ens193 is not configured. So, it will have
ifindex = 0 and mroute_vif_index = -1.
Currently, we don't enable MLD on an interface if
mroute_vif_index < 0. So, pim_ifp->MLD = NULL.
In the API pim_if_membership_refresh(), we are accessing
pim_ifp->MLD NULL pointer which leads to crash.

Fix:
Added NULL check before accessing pim_ifp->MLD pointer in
the API pim_if_membership_refresh().

Issue: #13385

Signed-off-by: Sarita Patra <saritap@vmware.com>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 months agolib, zebra: Ensure that the ifp->node exists
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>
10 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>
10 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>
10 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

10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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

10 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

10 months agotests: Convert to using logger.warning
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>
10 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

10 months agovtysh: Give actual pam error messages
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>
10 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

10 months agotests: selecting results by regexp and ragnes, add container support
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>
10 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

10 months agotests: ospfapi: fix non-determinism in test
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>