]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
21 months agomgmtd: convert map to darr use allowing dynamic registrations 13887/head
Christian Hopps [Sat, 24 Jun 2023 16:35:47 +0000 (12:35 -0400)]
mgmtd: convert map to darr use allowing dynamic registrations

- move from the static allocated and initialize xpath map to using the
new darr (dynamic array) code.

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 5447d16b7389703e6a8e0af7e9faaf153b2c4ad2)

21 months agolib: add dynamic array type
Christian Hopps [Fri, 23 Jun 2023 18:34:47 +0000 (14:34 -0400)]
lib: add dynamic array type

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit e6e0c5bd25599c76bd05db3c2e3f32f6d3fe47bb)

# Conflicts:
# .clang-format

22 months agomgmtd: remove unused "placeholder" code.
Christian Hopps [Tue, 27 Jun 2023 18:12:39 +0000 (14:12 -0400)]
mgmtd: remove unused "placeholder" code.

We don't need un-run/un-tested placeholder code we may never need.

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 70fb3910dbe81c8d44dcfa77c070b0a6e83d3607)

22 months agomgmtd: consolidate getcfg and getdata msgs into "get"
Christian Hopps [Tue, 27 Jun 2023 17:58:54 +0000 (13:58 -0400)]
mgmtd: consolidate getcfg and getdata msgs into "get"

eliminates tons of copy and paste code.

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit dbb1bc6f355ae53ce1f2402a1ac196e9f9e18a42)

22 months agomgmtd: inclusive language change
Christian Hopps [Mon, 26 Jun 2023 16:59:59 +0000 (12:59 -0400)]
mgmtd: inclusive language change

'cfg_btch' -> 'batch' and 'btch_list' -> 'batch_list'

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 6267c2aaad2a503ae24885d3ffc9a7867fccb6c0)

22 months agoMerge pull request #13871 from FRRouting/mergify/bp/dev/9.0/pr-13850
Donatas Abraitis [Thu, 29 Jun 2023 08:20:28 +0000 (11:20 +0300)]
Merge pull request #13871 from FRRouting/mergify/bp/dev/9.0/pr-13850

pimd: Fix memory leak in PIM interface deletion (backport #13850)

22 months agopimd: Fix memory leak in PIM interface deletion 13871/head
Keelan10 [Mon, 26 Jun 2023 10:56:26 +0000 (14:56 +0400)]
pimd: Fix memory leak in PIM interface deletion

This commit ensures proper cleanup by deleting the gm_join_list when a PIM interface is deleted. The gm_join_list was previously not being freed, causing a memory leak.

The ASan leak log for reference:
```
***********************************************************************************
Address Sanitizer Error detected in multicast_mld_join_topo1.test_multicast_mld_local_join/r1.asan.pim6d.28070

=================================================================
==28070==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 40 byte(s) in 1 object(s) allocated from:
    #0 0x7f3605dbfd28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x56230373dd6b in qcalloc lib/memory.c:105
    #2 0x56230372180f in list_new lib/linklist.c:49
    #3 0x56230361b589 in pim_if_gm_join_add pimd/pim_iface.c:1313
    #4 0x562303642247 in lib_interface_gmp_address_family_static_group_create pimd/pim_nb_config.c:2868
    #5 0x562303767280 in nb_callback_create lib/northbound.c:1235
    #6 0x562303767280 in nb_callback_configuration lib/northbound.c:1579
    #7 0x562303768a1d in nb_transaction_process lib/northbound.c:1710
    #8 0x56230376904a in nb_candidate_commit_apply lib/northbound.c:1104
    #9 0x5623037692ba in nb_candidate_commit lib/northbound.c:1137
    #10 0x562303769dec in nb_cli_classic_commit lib/northbound_cli.c:49
    #11 0x56230376fb79 in nb_cli_pending_commit_check lib/northbound_cli.c:88
    #12 0x5623036c5bcb in cmd_execute_command_real lib/command.c:991
    #13 0x5623036c5f1b in cmd_execute_command lib/command.c:1053
    #14 0x5623036c6392 in cmd_execute lib/command.c:1221
    #15 0x5623037e75da in vty_command lib/vty.c:591
    #16 0x5623037e7a74 in vty_execute lib/vty.c:1354
    #17 0x5623037f0253 in vtysh_read lib/vty.c:2362
    #18 0x5623037db4e8 in event_call lib/event.c:1995
    #19 0x562303720f97 in frr_run lib/libfrr.c:1213
    #20 0x56230368615d in main pimd/pim6_main.c:184
    #21 0x7f360461bc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 192 byte(s) in 4 object(s) allocated from:
    #0 0x7f3605dbfd28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x56230373dd6b in qcalloc lib/memory.c:105
    #2 0x56230361b91d in gm_join_new pimd/pim_iface.c:1288
    #3 0x56230361b91d in pim_if_gm_join_add pimd/pim_iface.c:1326
    #4 0x562303642247 in lib_interface_gmp_address_family_static_group_create pimd/pim_nb_config.c:2868
    #5 0x562303767280 in nb_callback_create lib/northbound.c:1235
    #6 0x562303767280 in nb_callback_configuration lib/northbound.c:1579
    #7 0x562303768a1d in nb_transaction_process lib/northbound.c:1710
    #8 0x56230376904a in nb_candidate_commit_apply lib/northbound.c:1104
    #9 0x5623037692ba in nb_candidate_commit lib/northbound.c:1137
    #10 0x562303769dec in nb_cli_classic_commit lib/northbound_cli.c:49
    #11 0x56230376fb79 in nb_cli_pending_commit_check lib/northbound_cli.c:88
    #12 0x5623036c5bcb in cmd_execute_command_real lib/command.c:991
    #13 0x5623036c5f1b in cmd_execute_command lib/command.c:1053
    #14 0x5623036c6392 in cmd_execute lib/command.c:1221
    #15 0x5623037e75da in vty_command lib/vty.c:591
    #16 0x5623037e7a74 in vty_execute lib/vty.c:1354
    #17 0x5623037f0253 in vtysh_read lib/vty.c:2362
    #18 0x5623037db4e8 in event_call lib/event.c:1995
    #19 0x562303720f97 in frr_run lib/libfrr.c:1213
    #20 0x56230368615d in main pimd/pim6_main.c:184
    #21 0x7f360461bc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 96 byte(s) in 4 object(s) allocated from:
    #0 0x7f3605dbfd28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x56230373dd6b in qcalloc lib/memory.c:105
    #2 0x562303721651 in listnode_new lib/linklist.c:71
    #3 0x56230372182b in listnode_add lib/linklist.c:92
    #4 0x56230361ba9a in gm_join_new pimd/pim_iface.c:1295
    #5 0x56230361ba9a in pim_if_gm_join_add pimd/pim_iface.c:1326
    #6 0x562303642247 in lib_interface_gmp_address_family_static_group_create pimd/pim_nb_config.c:2868
    #7 0x562303767280 in nb_callback_create lib/northbound.c:1235
    #8 0x562303767280 in nb_callback_configuration lib/northbound.c:1579
    #9 0x562303768a1d in nb_transaction_process lib/northbound.c:1710
    #10 0x56230376904a in nb_candidate_commit_apply lib/northbound.c:1104
    #11 0x5623037692ba in nb_candidate_commit lib/northbound.c:1137
    #12 0x562303769dec in nb_cli_classic_commit lib/northbound_cli.c:49
    #13 0x56230376fb79 in nb_cli_pending_commit_check lib/northbound_cli.c:88
    #14 0x5623036c5bcb in cmd_execute_command_real lib/command.c:991
    #15 0x5623036c5f1b in cmd_execute_command lib/command.c:1053
    #16 0x5623036c6392 in cmd_execute lib/command.c:1221
    #17 0x5623037e75da in vty_command lib/vty.c:591
    #18 0x5623037e7a74 in vty_execute lib/vty.c:1354
    #19 0x5623037f0253 in vtysh_read lib/vty.c:2362
    #20 0x5623037db4e8 in event_call lib/event.c:1995
    #21 0x562303720f97 in frr_run lib/libfrr.c:1213
    #22 0x56230368615d in main pimd/pim6_main.c:184
    #23 0x7f360461bc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 48 byte(s) in 1 object(s) allocated from:
    #0 0x7f3605dbfd28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x56230373dd6b in qcalloc lib/memory.c:105
    #2 0x56230361b91d in gm_join_new pimd/pim_iface.c:1288
    #3 0x56230361b91d in pim_if_gm_join_add pimd/pim_iface.c:1326
    #4 0x562303642247 in lib_interface_gmp_address_family_static_group_create pimd/pim_nb_config.c:2868
    #5 0x562303767280 in nb_callback_create lib/northbound.c:1235
    #6 0x562303767280 in nb_callback_configuration lib/northbound.c:1579
    #7 0x562303768a1d in nb_transaction_process lib/northbound.c:1710
    #8 0x56230376904a in nb_candidate_commit_apply lib/northbound.c:1104
    #9 0x5623037692ba in nb_candidate_commit lib/northbound.c:1137
    #10 0x562303769dec in nb_cli_classic_commit lib/northbound_cli.c:49
    #11 0x56230376fb79 in nb_cli_pending_commit_check lib/northbound_cli.c:88
    #12 0x5623036c5bcb in cmd_execute_command_real lib/command.c:991
    #13 0x5623036c5f6f in cmd_execute_command lib/command.c:1072
    #14 0x5623036c6392 in cmd_execute lib/command.c:1221
    #15 0x5623037e75da in vty_command lib/vty.c:591
    #16 0x5623037e7a74 in vty_execute lib/vty.c:1354
    #17 0x5623037f0253 in vtysh_read lib/vty.c:2362
    #18 0x5623037db4e8 in event_call lib/event.c:1995
    #19 0x562303720f97 in frr_run lib/libfrr.c:1213
    #20 0x56230368615d in main pimd/pim6_main.c:184
    #21 0x7f360461bc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x7f3605dbfd28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x56230373dd6b in qcalloc lib/memory.c:105
    #2 0x562303721651 in listnode_new lib/linklist.c:71
    #3 0x56230372182b in listnode_add lib/linklist.c:92
    #4 0x56230361ba9a in gm_join_new pimd/pim_iface.c:1295
    #5 0x56230361ba9a in pim_if_gm_join_add pimd/pim_iface.c:1326
    #6 0x562303642247 in lib_interface_gmp_address_family_static_group_create pimd/pim_nb_config.c:2868
    #7 0x562303767280 in nb_callback_create lib/northbound.c:1235
    #8 0x562303767280 in nb_callback_configuration lib/northbound.c:1579
    #9 0x562303768a1d in nb_transaction_process lib/northbound.c:1710
    #10 0x56230376904a in nb_candidate_commit_apply lib/northbound.c:1104
    #11 0x5623037692ba in nb_candidate_commit lib/northbound.c:1137
    #12 0x562303769dec in nb_cli_classic_commit lib/northbound_cli.c:49
    #13 0x56230376fb79 in nb_cli_pending_commit_check lib/northbound_cli.c:88
    #14 0x5623036c5bcb in cmd_execute_command_real lib/command.c:991
    #15 0x5623036c5f6f in cmd_execute_command lib/command.c:1072
    #16 0x5623036c6392 in cmd_execute lib/command.c:1221
    #17 0x5623037e75da in vty_command lib/vty.c:591
    #18 0x5623037e7a74 in vty_execute lib/vty.c:1354
    #19 0x5623037f0253 in vtysh_read lib/vty.c:2362
    #20 0x5623037db4e8 in event_call lib/event.c:1995
    #21 0x562303720f97 in frr_run lib/libfrr.c:1213
    #22 0x56230368615d in main pimd/pim6_main.c:184
    #23 0x7f360461bc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

SUMMARY: AddressSanitizer: 400 byte(s) leaked in 11 allocation(s).
***********************************************************************************
```

Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
(cherry picked from commit 24379f0bb29e276f2d9a06468973883f79dcaf45)

22 months agoMerge pull request #13863 from FRRouting/mergify/bp/dev/9.0/pr-13854
Donatas Abraitis [Wed, 28 Jun 2023 06:13:40 +0000 (09:13 +0300)]
Merge pull request #13863 from FRRouting/mergify/bp/dev/9.0/pr-13854

zebra: fix evpn rmac nh list cmp function (backport #13854)

22 months agozebra: fix evpn rmac nh list cmp function 13863/head
Chirag Shah [Mon, 26 Jun 2023 22:29:59 +0000 (15:29 -0700)]
zebra: fix evpn rmac nh list cmp function

EVPN RMAC (Router MAC) nexthop list compare
function needs to return all values so
the list element can be compared and added/deleted
properly.

Ticket:#3486989
Testing Done:
Originate EVPN Type-5 route with PIP IP and MAC as remote
nexthops.
Change the PIP IP address which triggers nexthop change.

Before fix:
When PIP IP changes RMAC is deleted from remote VTEPs.

TORS1# show evpn next-hops vni 4001 | include 00:02:00:00:00:2d
27.0.0.11       00:02:00:00:00:2d
TORS1# show evpn rmac vni 4001 | include 00:02:00:00:00:2d
00:02:00:00:00:2d 27.0.0.11

----- Remote VTEP change nexthop IP to 172.16.16.16 -----

TORS1# show evpn next-hops vni 4001 | include 00:02:00:00:00:2d
172.16.16.16    00:02:00:00:00:2d
TORS1# show evpn rmac vni 4001 | include 00:02:00:00:00:2d
TORS1#

After fix:
RMAC is retained as its nexthop list is not empty,
thus it is not deleted from remote VTEPs.

TORS1# show evpn rmac vni 4001 | include 00:02:00:00:00:2d
00:02:00:00:00:2d 172.16.16.16

Log:
2023/06/27 00:50:36.833474 ZEBRA: [XREH0-ZYMH6] L3VNI 4001 Remote VTEP
change(27.0.0.11 -> 172.16.16.16) for RMAC 00:02:00:00:00:2d

Signed-off-by: Chirag Shah <chirag@nvidia.com>
(cherry picked from commit a7d77ee58bdcc7dfaccfb124d94f738f2b2b4696)

22 months agoMerge pull request #13849 from FRRouting/mergify/bp/dev/9.0/pr-13839
Donatas Abraitis [Mon, 26 Jun 2023 15:03:34 +0000 (18:03 +0300)]
Merge pull request #13849 from FRRouting/mergify/bp/dev/9.0/pr-13839

staticd: remove unused YANG module (backport #13839)

22 months agostaticd: remove unused YANG module 13849/head
Christian Hopps [Fri, 23 Jun 2023 17:16:18 +0000 (13:16 -0400)]
staticd: remove unused YANG module

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 632440683f891669b5ea31f1d9dc8472e014e860)

22 months agoMerge pull request #13846 from LabNConsulting/chopps/backport-13795 frr-9.0-rc
Jafar Al-Gharaibeh [Sun, 25 Jun 2023 15:22:34 +0000 (10:22 -0500)]
Merge pull request #13846 from LabNConsulting/chopps/backport-13795

backport of #13795

22 months agomgmtd: fix memleak 13846/head
Christian Hopps [Sun, 18 Jun 2023 17:39:27 +0000 (13:39 -0400)]
mgmtd: fix memleak

Use northbound functions for replace and merge when possible, rather
than duplicating the code.

Signed-off-by: Christian Hopps <chopps@labn.net>
22 months agomgmtd: KISS the locking code
Christian Hopps [Sun, 18 Jun 2023 20:19:54 +0000 (16:19 -0400)]
mgmtd: KISS the locking code

Move away from things like "lock if not locked" type code, require the
user has locked prior to geting to that point.

For now we warn if we are taking a lock we already had; however, this
should really be a failure point.

New requirements:

SETCFG -
  not implicit commit - requires user has locked candidate DS and they
    must unlock after

  implicit commit - requires user has locked candidate and running DS
    both locks will be unlocked on reply to the SETCFG

COMMITCFG -
  requires user has locked candidate and running DS and they must unlock
  after

  rollback - this code now get both locks and then does an unlock and
  early return thing on the adapter side. It needs to be un-special
  cased in follow up work that would also include tests for this
  functionality.

Signed-off-by: Christian Hopps <chopps@labn.net>
22 months agomgmtd: simplify locking, removing read locks
Christian Hopps [Wed, 14 Jun 2023 13:32:16 +0000 (09:32 -0400)]
mgmtd: simplify locking, removing read locks

Signed-off-by: Christian Hopps <chopps@labn.net>
22 months agolib: mgmtd: use short-circuit for locking
Christian Hopps [Mon, 12 Jun 2023 08:59:19 +0000 (04:59 -0400)]
lib: mgmtd: use short-circuit for locking

Signed-off-by: Christian Hopps <chopps@labn.net>
22 months agolib: mgmtd: re-purpose is_short_circuit and fix depth variable inc/dec
Christian Hopps [Fri, 16 Jun 2023 11:19:53 +0000 (07:19 -0400)]
lib: mgmtd: re-purpose is_short_circuit and fix depth variable inc/dec

`is_short_circuit` now is set to true when a message is being
short-circuit handled.

`short_circuit_depth` was being inc/dec inside conditional macro, move
that out of the macro.

Signed-off-by: Christian Hopps <chopps@labn.net>
22 months agoMerge pull request #13843 from FRRouting/mergify/bp/dev/9.0/pr-13768
Donatas Abraitis [Sat, 24 Jun 2023 20:12:10 +0000 (23:12 +0300)]
Merge pull request #13843 from FRRouting/mergify/bp/dev/9.0/pr-13768

mgmtd: improvements in logging and commentary (backport #13768)

22 months agolib: mgmtd: improvements in logging and commentary 13843/head
Christian Hopps [Fri, 9 Jun 2023 20:54:54 +0000 (16:54 -0400)]
lib: mgmtd: improvements in logging and commentary

- log names of datastores not numbers
- improve logging for mgmt_msg_read
- Rather than use a bool, instead store the pending const string name of
the command being run that has postponed the CLI. This adds some nice
information to the logging when enabled.

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 96f9e7853bad7e21676f2eb126a915561e6c8dce)

22 months agoMerge pull request #13840 from FRRouting/mergify/bp/dev/9.0/pr-13766
Jafar Al-Gharaibeh [Sat, 24 Jun 2023 14:30:54 +0000 (09:30 -0500)]
Merge pull request #13840 from FRRouting/mergify/bp/dev/9.0/pr-13766

mgmtd cleanup/simplify some code (backport #13766)

22 months agomgmtd: complex redux in txn cleanup 13840/head
Christian Hopps [Mon, 12 Jun 2023 04:26:50 +0000 (00:26 -0400)]
mgmtd: complex redux in txn cleanup

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit c9d153e5e9dc29459ec7d24640a817d3c6fcd222)

22 months agolib: mgmtd: simplify implicit commit code
Christian Hopps [Fri, 9 Jun 2023 20:52:56 +0000 (16:52 -0400)]
lib: mgmtd: simplify implicit commit code

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 70ff6bb80bf43e55171f328c96f0e45c634a4e1f)

22 months agoMerge pull request #13835 from FRRouting/mergify/bp/dev/9.0/pr-13764
Jafar Al-Gharaibeh [Fri, 23 Jun 2023 19:03:14 +0000 (14:03 -0500)]
Merge pull request #13835 from FRRouting/mergify/bp/dev/9.0/pr-13764

lib: mgmtd: make error handling more robust (backport #13764)

22 months agoMerge pull request #13833 from FRRouting/mergify/bp/dev/9.0/pr-13809
Jafar Al-Gharaibeh [Fri, 23 Jun 2023 13:35:57 +0000 (08:35 -0500)]
Merge pull request #13833 from FRRouting/mergify/bp/dev/9.0/pr-13809

doc: start of mgmtd developer doc (backport #13809)

22 months agolib: mgmtd: make error handling more robust 13835/head
Christian Hopps [Fri, 9 Jun 2023 15:03:54 +0000 (11:03 -0400)]
lib: mgmtd: make error handling more robust

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit d694cd40f2cb566245ca2c7851730095bf90b1a8)

22 months agoMerge pull request #13834 from FRRouting/mergify/bp/dev/9.0/pr-13763
Jafar Al-Gharaibeh [Fri, 23 Jun 2023 02:09:24 +0000 (21:09 -0500)]
Merge pull request #13834 from FRRouting/mergify/bp/dev/9.0/pr-13763

fix 'exit' bug in config file processing, et al. (backport #13763)

22 months agoMerge pull request #13832 from FRRouting/mergify/bp/dev/9.0/pr-13734
Jafar Al-Gharaibeh [Fri, 23 Jun 2023 02:09:08 +0000 (21:09 -0500)]
Merge pull request #13832 from FRRouting/mergify/bp/dev/9.0/pr-13734

remove mentions of socat (backport #13734)

22 months agotests: add mgmtd config test 13834/head
Christian Hopps [Mon, 12 Jun 2023 04:58:03 +0000 (00:58 -0400)]
tests: add mgmtd config test

Testing early exits/ends from config files loaded with `vtysh -f cfgfile`
as well as `vtysh < cfgfile`, verify the same as non-mgmtd behavior.

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit dac48df52ad6322b505aea7aae62319a726216b5)

22 months agolib: mgmtd: fix/stdize debug message macros
Christian Hopps [Mon, 12 Jun 2023 04:25:07 +0000 (00:25 -0400)]
lib: mgmtd: fix/stdize debug message macros

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 79d40972fddc2651b499bf2f5780aea97c9f5d07)

22 months agomgmtd: remove unused code
Christian Hopps [Fri, 9 Jun 2023 20:54:13 +0000 (16:54 -0400)]
mgmtd: remove unused code

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit f0fa4c03700e775f7ed7ebf6cfef20d9d5ac7ef9)

22 months agolib: mgmtd: session create and destroy both short-circuit
Christian Hopps [Mon, 12 Jun 2023 02:13:48 +0000 (22:13 -0400)]
lib: mgmtd: session create and destroy both short-circuit

For creation this is the first thing done so short-circuit just means inline
sync response. However, for destroy there could be commands in-flight, these
will be discarded when they match no session, and the state cleaned up
immediately when the message short-circuits.

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 0fc08fa7381fdba03a0c2e5b745929954172915a)

22 months agolib: mgmtd: avoid recursion with vty_close and add error log
Christian Hopps [Mon, 12 Jun 2023 02:19:54 +0000 (22:19 -0400)]
lib: mgmtd: avoid recursion with vty_close and add error log

Avoid recursion into vty_close() when being notified of a session closure that
happened inside vty_close().

If a vty is closed with outstanding config yet to be commited
issue a warning that it is being lost.

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 4307fdd07047dc2f7c9daef7a74af6cddf635c34)

22 months agovtysh: stop reading config file if user `exit`s from root level.
Christian Hopps [Sun, 11 Jun 2023 21:53:10 +0000 (17:53 -0400)]
vtysh: stop reading config file if user `exit`s from root level.

This is required to make sure that we properly send the
XFRR_end_configuration tag to the daemons. Previously if the user had an
`exit` at the root level the parser would just drop out of the config
node and so XFRR_end_configuration, even if sent, would be ignored

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 315e9032e4087494063bbc6f7f52ec8c3d3ce757)

22 months agostaticd: staticd no longer loads config files
Christian Hopps [Sat, 10 Jun 2023 03:15:12 +0000 (23:15 -0400)]
staticd: staticd no longer loads config files

We need to ignore SIGHUP rather than reload config now.

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit f7a2c2ab5ab6a4d70da298ad03cb28fdf9979afc)

22 months agodoc: start of mgmtd developer doc 13833/head
Christian Hopps [Mon, 19 Jun 2023 08:57:48 +0000 (04:57 -0400)]
doc: start of mgmtd developer doc

- docs on how to convert daemon to mgmtd and some diagrams
- and a fix for code-block in cspf.rst

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit a552543640f3558199aebb79cc823d189dfcd083)

22 months agodoc: update doc removing socat req + remove unused tests code 13832/head
Christian Hopps [Thu, 8 Jun 2023 12:37:27 +0000 (08:37 -0400)]
doc: update doc removing socat req + remove unused tests code

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 17054f373e70b5be08e45f8fd004190f857e7394)

22 months agoMerge pull request #13816 from FRRouting/mergify/bp/dev/9.0/pr-13758
Donatas Abraitis [Wed, 21 Jun 2023 13:47:02 +0000 (16:47 +0300)]
Merge pull request #13816 from FRRouting/mergify/bp/dev/9.0/pr-13758

isisd: Fix read beyond end of stream of ASLA Sub-TLV parsing (backport #13758)

22 months agoisisd: Fix use beyond end of stream of ASLA Sub-TLV parsing 13816/head
Carmine Scarpitta [Sat, 10 Jun 2023 14:08:25 +0000 (16:08 +0200)]
isisd: Fix use beyond end of stream of ASLA Sub-TLV parsing

Fixes a crash associated with attempting to read beyond the end of the
stream when parsing ASLA Sub-TLV.

```
Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
    subtlv_len=13 '\r') at isisd/isis_tlvs.c:1473
    at isisd/isis_tlvs.c:3264
    context=<optimized out>, mtid=<optimized out>) at isisd/isis_tlvs.c:6078
    indent=4) at isisd/isis_tlvs.c:6142
    avail_len=<optimized out>, context=<optimized out>) at isisd/isis_tlvs.c:7032
    at isisd/isis_tlvs.c:7054
(gdb)
```

Caught by fuzzer.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
(cherry picked from commit 2a9e0824a7bd85d5436615065f0311910106c3cf)

22 months agoMerge pull request #13786 from FRRouting/mergify/bp/dev/9.0/pr-13612
Donald Sharp [Tue, 13 Jun 2023 20:03:28 +0000 (16:03 -0400)]
Merge pull request #13786 from FRRouting/mergify/bp/dev/9.0/pr-13612

ospfd: fix interface param type update (backport #13612)

22 months agoMerge pull request #13791 from FRRouting/mergify/bp/dev/9.0/pr-13589
Donald Sharp [Tue, 13 Jun 2023 20:03:04 +0000 (16:03 -0400)]
Merge pull request #13791 from FRRouting/mergify/bp/dev/9.0/pr-13589

pbrd, zebra: fix zapi and netlink rule encoding (backport #13589)

22 months agopbrd, zebra: fix zapi and netlink rule encoding 13791/head
Mark Stapp [Tue, 23 May 2023 19:31:31 +0000 (15:31 -0400)]
pbrd, zebra: fix zapi and netlink rule encoding

In pbrd, don't encode a rule without a table. There are cases
where the zapi encoding was incorrect because the 4-octet
table id was missing. In zebra, mask off the ECN bits in the
TOS byte when encoding an iprule to match netlink's
expectation.

Signed-off-by: Mark Stapp <mjs@labn.net>
(cherry picked from commit 4112baec9f7ec235c66e2c5992ba2288ca1557e7)

22 months agoospfd: fix interface param type update 13786/head
Chirag Shah [Fri, 26 May 2023 20:43:50 +0000 (13:43 -0700)]
ospfd: fix interface param type update

interface link update event needs
to be handle properly in ospf interface
cache.

Example:
When vrf (interface) is created its default type
would be set to BROADCAST because ifp->status
is not set to VRF.
Subsequent link event sets ifp->status to vrf,
ospf interface update need to compare current type
to new default type which would be VRF (OSPF_IFTYPE_LOOPBACK).
Since ospf type param was created in first add event,
ifp vrf link event didn't update ospf type param which
leads to treat vrf as non loopback interface.

Ticket:#3459451
Testing Done:

Running config suppose to bypass rendering default
network broadcast for loopback/vrf types.

Before fix:

vrf vrf1
 vni 4001
exit-vrf
!
interface vrf1
 ip ospf network broadcast
exit

After fix: (interface vrf1 is not displayed).

vrf vrf1
 vni 4001
exit-vrf

Signed-off-by: Chirag Shah <chirag@nvidia.com>
(cherry picked from commit 0d005b2d5c294d9d0a8db9d8beca83b97e0fd8ff)

22 months agoMerge pull request #13760 from FRRouting/mergify/bp/dev/9.0/pr-13675
Donatas Abraitis [Sun, 11 Jun 2023 18:40:02 +0000 (21:40 +0300)]
Merge pull request #13760 from FRRouting/mergify/bp/dev/9.0/pr-13675

bfd:fix version bits check (backport #13675)

22 months agobfdd: fix version bits check. 13760/head
zmw12306 [Sat, 3 Jun 2023 19:08:34 +0000 (15:08 -0400)]
bfdd: fix version bits check.

The version of bfd pkt is represented by 3 bits in B[0].
Signed-off-by: zmw12306 <zmw12306@gmail.com>
(cherry picked from commit 3f658e8b1cfc82e1644cc36fcbc1554c70f558d0)

22 months agoMerge pull request #13744 from FRRouting/mergify/bp/dev/9.0/pr-13726
Donatas Abraitis [Fri, 9 Jun 2023 12:37:42 +0000 (15:37 +0300)]
Merge pull request #13744 from FRRouting/mergify/bp/dev/9.0/pr-13726

tests: fixing pim6 topotest bugs (backport #13726)

22 months agoMerge pull request #13746 from FRRouting/mergify/bp/dev/9.0/pr-13739
Donatas Abraitis [Fri, 9 Jun 2023 12:37:05 +0000 (15:37 +0300)]
Merge pull request #13746 from FRRouting/mergify/bp/dev/9.0/pr-13739

zebra: Prevent crash because nl is NULL on shutdown (backport #13739)

22 months agoMerge pull request #13741 from FRRouting/mergify/bp/dev/9.0/pr-13364
Donatas Abraitis [Fri, 9 Jun 2023 07:15:15 +0000 (10:15 +0300)]
Merge pull request #13741 from FRRouting/mergify/bp/dev/9.0/pr-13364

bfd: fix missing Authentication in control pkt (backport #13364)

22 months agoMerge pull request #13736 from FRRouting/mergify/bp/dev/9.0/pr-13645
Jafar Al-Gharaibeh [Fri, 9 Jun 2023 04:47:51 +0000 (23:47 -0500)]
Merge pull request #13736 from FRRouting/mergify/bp/dev/9.0/pr-13645

bfdd: remove redundant nb destroy callbacks (backport #13645)

22 months agozebra: Prevent crash because nl is NULL on shutdown 13746/head
Donald Sharp [Thu, 8 Jun 2023 16:03:49 +0000 (12:03 -0400)]
zebra: Prevent crash because nl is NULL on shutdown

When shutting down the main pthread was first closing
the sockets associated with the dplane pthread and
then telling it to shutdown the pthread at a later point
in time.  This caused the dplane to crash because the nl
data has been freed already.  Change the shutdown order
to stop the dplane pthread *and* then close the sockets.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 977d7e24fff4e0eef4426bbcc32e491a60815b89)

22 months agotests: convert old pim test to more cleanly use pytest fixture 13744/head
Christian Hopps [Thu, 8 Jun 2023 08:12:26 +0000 (04:12 -0400)]
tests: convert old pim test to more cleanly use pytest fixture

This is a good way to run a per-test background helper process. Here the
helper object is created before the test function requesting it (through param
name match), and then cleaned up after the test function exits (pass or failed).

A context manager is used to further guarantee the cleanup is done.

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit b28bc2561e7231e410e304f7ec23f9d795e3e479)

22 months agotests: fixing pim6 topotest bugs
Christian Hopps [Thu, 8 Jun 2023 06:42:32 +0000 (02:42 -0400)]
tests: fixing pim6 topotest bugs

- Remove use of bespoke socat
- Use ipv6 support in mcast-tester.py
- do not run processes in the background behind munet/micronet's
  back with `&` (ever) -- use popen or the helper class

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit efedb1897616c6de76aaaff7a51f443dbbe93e31)

22 months agotests: mcast-tester.py handles IPv6
Christian Hopps [Thu, 8 Jun 2023 06:11:50 +0000 (02:11 -0400)]
tests: mcast-tester.py handles IPv6

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 71231d304f257aed9a086fcf6c2146052574b2f4)

22 months agobfd: fix missing Authentication in control pkt 13741/head
zmw12306 [Tue, 25 Apr 2023 17:48:18 +0000 (13:48 -0400)]
bfd: fix missing Authentication in control pkt

According RFC 5880, add a simpilfed version handling authentication
Signed-off-by: zmw12306 <zmw12306@gmail.com>
(cherry picked from commit 98707b04d425dfcc24670704d268a733bbf0bc3f)

22 months agobfdd: remove redundant nb destroy callbacks 13736/head
Igor Ryzhov [Wed, 31 May 2023 12:28:08 +0000 (15:28 +0300)]
bfdd: remove redundant nb destroy callbacks

Fixes warning logs:
```
2023/05/29 20:11:50 BFD: [ZKB8W-3S2Q4][EC 100663330] unneeded 'destroy' callback for '/frr-bfdd:bfdd/bfd/profile/minimum-ttl'
2023/05/29 20:11:50 BFD: [ZKB8W-3S2Q4][EC 100663330] unneeded 'destroy' callback for '/frr-bfdd:bfdd/bfd/sessions/multi-hop/minimum-ttl'
```

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
(cherry picked from commit f7884aedf7a1249e3aae71b6a66c9a0f0915c4ef)

22 months agoMerge pull request #13723 from FRRouting/mergify/bp/dev/9.0/pr-13624
Donatas Abraitis [Thu, 8 Jun 2023 05:35:22 +0000 (08:35 +0300)]
Merge pull request #13723 from FRRouting/mergify/bp/dev/9.0/pr-13624

bgpd: Free temp memory (backport #13624)

22 months agobgpd: Free temp memory 13723/head
Keelan10 [Mon, 29 May 2023 07:42:40 +0000 (11:42 +0400)]
bgpd: Free temp memory

This commit addresses a memory leak issue in the BGP Flowspec NLRI parsing function.

Previously when processing NLRI, dynamically allocated memory to `temp` was not being freed, leading to a memory leak.

The commit introduces the necessary code (XFREE) to properly free the temp memory after processing Flowspec NLRI.

The ASan leak log for reference:

```
./bgp_flowspec.test_bgp_flowspec_topo/r1.bgpd.asan.687689:Direct leak of 56 byte(s) in 2 object(s) allocated from:
./bgp_flowspec.test_bgp_flowspec_topo/r1.bgpd.asan.687689-    #0 0x7fc9872b5037 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
./bgp_flowspec.test_bgp_flowspec_topo/r1.bgpd.asan.687689-    #1 0x7fc986e5b1ee in qcalloc lib/memory.c:105
./bgp_flowspec.test_bgp_flowspec_topo/r1.bgpd.asan.687689-    #2 0x560421351bfe in bgp_nlri_parse_flowspec bgpd/bgp_flowspec.c:155
./bgp_flowspec.test_bgp_flowspec_topo/r1.bgpd.asan.687689-    #3 0x56042107d01c in bgp_nlri_parse bgpd/bgp_packet.c:350
./bgp_flowspec.test_bgp_flowspec_topo/r1.bgpd.asan.687689-    #4 0x560421086cf3 in bgp_update_receive bgpd/bgp_packet.c:2023
./bgp_flowspec.test_bgp_flowspec_topo/r1.bgpd.asan.687689-    #5 0x56042108deed in bgp_process_packet bgpd/bgp_packet.c:2933
./bgp_flowspec.test_bgp_flowspec_topo/r1.bgpd.asan.687689-    #6 0x7fc986f35bf7 in event_call lib/event.c:1995
./bgp_flowspec.test_bgp_flowspec_topo/r1.bgpd.asan.687689-    #7 0x7fc986e1e99d in frr_run lib/libfrr.c:1185
./bgp_flowspec.test_bgp_flowspec_topo/r1.bgpd.asan.687689-    #8 0x560420f3f59d in main bgpd/bgp_main.c:505
./bgp_flowspec.test_bgp_flowspec_topo/r1.bgpd.asan.687689-    #9 0x7fc986805d09 in __libc_start_main ../csu/libc-start.c:308
```

Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
(cherry picked from commit 269a2d3dae0016a0c9688d18d0cce6dfd21b8ae3)

22 months agoMerge pull request #13712 from FRRouting/mergify/bp/dev/9.0/pr-13693
Donald Sharp [Wed, 7 Jun 2023 12:07:40 +0000 (08:07 -0400)]
Merge pull request #13712 from FRRouting/mergify/bp/dev/9.0/pr-13693

tools: fix list value remove in frr-reload (backport #13693)

22 months agoMerge pull request #13711 from FRRouting/mergify/bp/dev/9.0/pr-13706
Donatas Abraitis [Wed, 7 Jun 2023 10:23:14 +0000 (13:23 +0300)]
Merge pull request #13711 from FRRouting/mergify/bp/dev/9.0/pr-13706

lib: close config files after reading (coverity) (backport #13706)

22 months agoMerge pull request #13710 from FRRouting/mergify/bp/dev/9.0/pr-13707
Donatas Abraitis [Wed, 7 Jun 2023 09:49:27 +0000 (12:49 +0300)]
Merge pull request #13710 from FRRouting/mergify/bp/dev/9.0/pr-13707

mgmtd: assert an assertion for coverity (backport #13707)

22 months agotools: fix list value remove in frr-reload 13712/head
Chirag Shah [Tue, 6 Jun 2023 04:48:12 +0000 (21:48 -0700)]
tools: fix list value remove in frr-reload

There might be a time element(s) from
temporary list are removed more than once
which leads to valueError in certain python3
version.

commit-id 1543f58b5 did not handle valueError
properly. This caused regression where
prefix-list config leads to delete followed
by add.

The new fix should just pass the exception as
value removal from list_to_add or list_to_del
is best effort.
This allows prefix-list config has no change
then removes the lines from lines_to_del and
lines_to_add properly.

Ticket:#3490252
Testing:

Configure prefix-list in frr.conf and perform
multiple frr-reload. After first reload operatoin
subsequent ones should not result in delete followed
by add of the prefix-list but rather no-op operation.

(Pdb) lines_to_add
[(('ip prefix-list FOO permit 10.2.1.0/24',), None)]
(Pdb) lines_to_del
[(('ip prefix-list FOO seq 5 permit 10.2.1.0/24',), None),
 (('ip prefix-list FOO seq 10 permit 10.2.1.0/24',), None)]
(Pdb) lines_to_del_to_del
[(('ip prefix-list FOO seq 5 permit 10.2.1.0/24',), None),
 (('ip prefix-list FOO seq 10 permit 10.2.1.0/24',), None)]
(Pdb) lines_to_add_to_del
[(('ip prefix-list FOO permit 10.2.1.0/24',), None),
 (('ip prefix-list FOO permit 10.2.1.0/24',), None)]
(Pdb) c
> /usr/lib/frr/frr-reload.py(1562)ignore_delete_re_add_lines()
-> return (lines_to_add, lines_to_del)
(Pdb) lines_to_add
[]
(Pdb) lines_to_del
[]

Signed-off-by: Chirag Shah <chirag@nvidia.com>
(cherry picked from commit 9845c09d61a7e509bfae369648cb5f9893455ac4)

22 months agolib: close config files after reading (coverity) 13711/head
Christian Hopps [Tue, 6 Jun 2023 18:27:04 +0000 (14:27 -0400)]
lib: close config files after reading (coverity)

fixes coverity CID# 1564375

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit f5626596ee5e052fc1116536704cd9c9ba5d7552)

22 months agomgmtd: assert an assertion for coverity 13710/head
Christian Hopps [Tue, 6 Jun 2023 19:12:58 +0000 (15:12 -0400)]
mgmtd: assert an assertion for coverity

I believe coverity can't tell the length of the return value from strftime based
on the format string (like we can), so it allows `n` to be larger than it could
be which then allows `sz - n` to be negative which is size_t positive and very
large so it thinks an overrun is possible.

CID#1563211

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 565139a6d5c2541e7b740a4a972dd7c18a87a984)

22 months agoMerge pull request #13701 from opensourcerouting/fix/update_show_ip_bgp_summary_doc base_9.0
Donald Sharp [Tue, 6 Jun 2023 18:55:52 +0000 (14:55 -0400)]
Merge pull request #13701 from opensourcerouting/fix/update_show_ip_bgp_summary_doc

doc: Document RFC8212 under `Displaying BGP Information` section

22 months agoMerge pull request #13687 from donaldsharp/eigrp_fakeout
Jafar Al-Gharaibeh [Tue, 6 Jun 2023 18:53:27 +0000 (13:53 -0500)]
Merge pull request #13687 from donaldsharp/eigrp_fakeout

tests: Babel tests do not need to log to eigrp

22 months agotests: Babel tests do not need to log to eigrp 13687/head
Donald Sharp [Mon, 5 Jun 2023 12:28:22 +0000 (08:28 -0400)]
tests: Babel tests do not need to log to eigrp

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
22 months agodoc: Document RFC8212 under `Displaying BGP Information` section 13701/head
Donatas Abraitis [Tue, 6 Jun 2023 12:22:44 +0000 (15:22 +0300)]
doc: Document RFC8212 under `Displaying BGP Information` section

Looks like people don't find what does it mean (Policy) at first shot, let's
try giving more hints here.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agoMerge pull request #13690 from LabNConsulting/chopps/mgmtd-cleanup
Donald Sharp [Tue, 6 Jun 2023 11:22:31 +0000 (07:22 -0400)]
Merge pull request #13690 from LabNConsulting/chopps/mgmtd-cleanup

Chopps/mgmtd cleanup

22 months agoMerge pull request #13618 from LabNConsulting/chopps/fixlogging
Martin Winter [Tue, 6 Jun 2023 09:35:20 +0000 (02:35 -0700)]
Merge pull request #13618 from LabNConsulting/chopps/fixlogging

22 months agoMerge pull request #13649 from donaldsharp/unlock_the_node_or_else
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

22 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

22 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

22 months agomgmtd: rm unused/unneeded code add couple comments 13690/head
Christian Hopps [Sun, 4 Jun 2023 22:09:25 +0000 (18:09 -0400)]
mgmtd: rm unused/unneeded code add couple comments

Signed-off-by: Christian Hopps <chopps@labn.net>
22 months agoldpd: changes for code maintainability 13689/head
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>
22 months agotests: mgmtd: add prologue to bigconf tests
Christian Hopps [Sun, 4 Jun 2023 21:48:08 +0000 (17:48 -0400)]
tests: mgmtd: add prologue to bigconf tests

Signed-off-by: Christian Hopps <chopps@labn.net>
22 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

22 months agotests: fix some broken logging 13618/head
Christian Hopps [Sat, 27 May 2023 16:11:48 +0000 (12:11 -0400)]
tests: fix some broken logging

- make sure we close and remove all handlers for named logs on each reuse.
- test module level exec.log no longer truncated to last test case output
- cleanup the log names, and make sure they are present in all exec logs
- keep separate exec logs for each pytest worker when running in distributed mode
- disabled code due to CI infra can't handle it: add per test case exec logs

Signed-off-by: Christian Hopps <chopps@labn.net>
22 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

22 months agomgmtd: Fix up some coverity issues 13670/head
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>
22 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>
22 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>
22 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

22 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

22 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

22 months agoldpd: changes for code maintainability 13685/head
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>
22 months agotests: pause (with CLI) at step() functions when run with --pause 13684/head
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>
22 months agolib: mgmtd: remove abstraction layer and other cleanup 13681/head
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>
22 months agolib: mgmtd: remove obfuscating abstraction layer and other cleanup 13677/head
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>
22 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

22 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

22 months agobgpd: Give more data when state machine fails to change state 13668/head
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>
22 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

22 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

22 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

22 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

22 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

22 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

22 months agobgpd: Fix typo in debug message 13660/head
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>
22 months agotests: new mgmt_startup tests are failing due to insufficient time 13659/head
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>
22 months agoeigrpd: dest_addr does not need to be set to NULL 13641/head
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>
22 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>