Commit Graph

32098 Commits

Author SHA1 Message Date
Donald Sharp
b107092ce7
Merge pull request #13685 from sri-mohan1/srib-ldpd1
ldpd: changes for code maintainability
2023-06-05 10:52:46 -04:00
Donald Sharp
4285bdadcc
Merge pull request #13684 from LabNConsulting/chopps/pause-functionality
tests: pause (with CLI) at step() functions when run with --pause
2023-06-05 07:53:54 -04:00
Donald Sharp
dfbccb4cb8
Merge pull request #13681 from LabNConsulting/chopps/bad-abstract2
lib: mgmtd: remove backend abstraction layer and other cleanup
2023-06-05 07:53:31 -04:00
Donald Sharp
42d6f84585
Merge pull request #13677 from LabNConsulting/chopps/bad-abstract
lib: mgmtd: remove obfuscating abstraction layer and other cleanup
2023-06-05 07:51:25 -04:00
sri-mohan1
233b5d0f2e ldpd: changes for code maintainability
these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2023-06-05 10:53:27 +05:30
Christian Hopps
be3c453556 tests: pause (with CLI) at step() functions when run with --pause
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-06-04 17:38:19 -04:00
Christian Hopps
7aecb8639c 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>
2023-06-04 16:41:24 -04:00
Christian Hopps
65256cd8f7 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>
2023-06-04 16:38:19 -04:00
Donatas Abraitis
1bafbcb24a
Merge pull request #13656 from sri-mohan1/srib-ldpd1
ldpd: changes for code maintainability
2023-06-04 22:37:04 +03:00
Donatas Abraitis
76eb208e79
Merge pull request #13668 from donaldsharp/fsm_more_descriptive
bgpd: Give more data when state machine fails to change state
2023-06-04 22:36:43 +03:00
Donald Sharp
907234817c 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>
2023-06-02 11:02:54 -04:00
Donatas Abraitis
ff82184fae
Merge pull request #13659 from donaldsharp/increase_mgmt_time
tests: new mgmt_startup tests are failing due to insufficient time
2023-06-02 09:50:28 +03:00
Donatas Abraitis
0f1a66f2c5
Merge pull request #13646 from donaldsharp/logically_illogical
mgmtd: xpath is already NULL in the failure path
2023-06-02 09:19:04 +03:00
mobash-rasool
205d27014f
Merge pull request #13641 from donaldsharp/com_list_str
Bunch of code cleanup from Coverity
2023-06-02 08:14:10 +05:30
mobash-rasool
e4bdeb6aca
Merge pull request #13660 from anlancs/bgpd-cleanup-12
bgpd: Fix typo in debug message
2023-06-02 08:11:55 +05:30
Donatas Abraitis
89eaf9b7a0
Merge pull request #13637 from yyuanam/fix_vtysh_core
lib: fix vtysh core when handling questionmark
2023-06-01 22:30:50 +03:00
Donatas Abraitis
2cf6941f1d
Merge pull request #13653 from dpward/ospf6d-redundant-lsa
ospf6d: Prevent redundant LSA generation before interface goes down
2023-06-01 22:24:45 +03:00
anlan_cs
32e29c746a 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>
2023-06-01 23:31:45 +08:00
Donald Sharp
84af55b268 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>
2023-06-01 09:57:48 -04:00
Donald Sharp
56cc0c2478 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>
2023-06-01 08:58:16 -04:00
Donald Sharp
c36bd47d76 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>
2023-06-01 08:58:16 -04:00
Donald Sharp
6e233c77d8 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>
2023-06-01 08:58:16 -04:00
Donald Sharp
3ddf7680fd zebra: Consolidate the stream_failure section with normal return
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-06-01 08:58:16 -04:00
Donald Sharp
c2cf522347 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>
2023-06-01 08:54:25 -04:00
Donald Sharp
1f7038386e 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>
2023-06-01 08:54:25 -04:00
Donald Sharp
3f1b34c498
Merge pull request #13652 from opensourcerouting/fix/drop_old_releases_from_the_table
doc: Update reference table for current and upcoming release dates
2023-06-01 08:27:54 -04:00
sri-mohan1
a3b7872c66 ldpd: changes for code maintainability
these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2023-06-01 13:30:35 +05:30
Donatas Abraitis
8d4eeb9026
Merge pull request #13450 from patrasar/mld_core
pim6d: Fix crash in ipv6 pim command
2023-06-01 09:13:30 +03:00
David Ward
4a1696818f ospf6d: Prevent redundant LSA generation before interface goes down
Commit 76249532fa ("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>
2023-05-31 16:44:44 -04:00
Yuan Yuan
f8aa257997 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>
2023-05-31 20:30:03 +00:00
Donatas Abraitis
b28e2c59dc 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>
2023-05-31 23:17:27 +03:00
Donald Sharp
af001e29f9 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>
2023-05-31 07:54:10 -04:00
Donald Sharp
7470509390
Merge pull request #13632 from LabNConsulting/chopps/mgmt-avoid-race
mgmtd: fix possible race btw read config and backend connection
2023-05-31 07:28:50 -04:00
Donald Sharp
a53c4891fd
Merge pull request #13639 from opensourcerouting/ospf-timestamp-truncation
ospfd, ospf6d: fix time_t truncation
2023-05-31 07:26:06 -04:00
Donatas Abraitis
549f664d39
Merge pull request #13634 from yyuanam/fix_bgp_core
bgpd: fix bgpd core when unintern attr
2023-05-31 08:57:40 +03:00
Jafar Al-Gharaibeh
adea8ef308
Merge pull request #13635 from donaldsharp/give_ping_a_chance
tests: Actually loop if ping fails
2023-05-30 18:59:44 -05:00
Yuan Yuan
32af4995aa 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>
2023-05-30 22:49:07 +00:00
Renato Westphal
2882096fad 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>
2023-05-30 19:47:28 -03:00
Donald Sharp
22c10bbdaa 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>
2023-05-30 15:43:42 -04:00
Donatas Abraitis
147c7a2de3
Merge pull request #13631 from donaldsharp/fix_some_ping_issues
various issues
2023-05-30 21:26:24 +03:00
Christian Hopps
3744ad02d9 mgmtd: fix possible race btw read config and backend connection
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-30 11:52:19 -04:00
Donald Sharp
9be555f8d4
Merge pull request #13601 from opensourcerouting/build-yang-embed-20230525
build: fix missing YANG model embedding
2023-05-30 11:34:29 -04:00
mobash-rasool
46d0674da0
Merge pull request #13588 from sri-mohan1/srib-ldpd1
ldpd: changes for code maintainability
2023-05-30 21:02:31 +05:30
Donald Sharp
63e04998a7
Merge pull request #13414 from LabNConsulting/chopps/no-mgmtd-nowrite-on-off
rework messaging, resource handling in mgmtd with bug fix and code hardening
2023-05-30 10:48:32 -04:00
Christian Hopps
ff6b14a658 zebra: use ifindex vs ifp to avoid use-after-free on shutdown
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-30 04:09:29 -04:00
Christian Hopps
8cfe36bc7e zebra: avoid unneeded vxlan work on shutdown
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-30 04:09:29 -04:00
Christian Hopps
7cd87abc5e tests: add unified config tests
- simple unified test
- unified test with late backend startup test

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-30 04:09:29 -04:00
Sarita Patra
6d1d2c27a3 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>
2023-05-30 00:43:45 -07:00
Christian Hopps
51941c1916 mgmtd: address review comments
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-30 02:10:20 -04:00
Christian Hopps
8611886d52 mgmtd: fix clang uninit warning
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-30 02:10:20 -04:00