Commit graph

34453 commits

Author SHA1 Message Date
Igor Ryzhov 771c8f3b2a mgmtd: cleanup txn without scheduling
If the transaction is not cleaned up immediately, it can be still
referenced by some threds. If it's a commit thread and it's executed
before the actual cleanup, mgmtd crashes because of the missing
commit_cfg_req.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-26 12:34:46 -05:00
Igor Ryzhov 7e27469337 mgmtd: fix log type
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-26 12:34:46 -05:00
Igor Ryzhov 42b815f488 mgmtd: fix sending the same value to multiple clients
The value should not be cleared after sending it to the first client,
otherwise other clients receive an empty string.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-26 12:34:46 -05:00
Igor Ryzhov 1bf395232d lib: fix removing access/prefix lists
CLI for access/prefix list removal was using `nb_cli_apply_changes`
multiple times in the same command. It's fine for regular daemons but
not for mgmtd. Refactor the code to apply changes only once.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-26 12:34:23 -05:00
Igor Ryzhov e39b60bac1 lib: add yang function for counting data nodes
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-26 12:34:23 -05:00
Christian Hopps 63ca751c11 lib: convert filters to mgmtd
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-26 12:34:23 -05:00
Christian Hopps dabc92de9e lib: convert route-map to mgmtd
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-26 12:34:23 -05:00
Christian Hopps f7594b55c2 doc: updates to mgmtd conversion documentation
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-26 12:34:23 -05:00
Donald Sharp a5613bd36d
Merge pull request #15210 from opensourcerouting/fix/use_enum_for_graceful_restart_prints
bgpd: Fix format overflow for graceful-restart debug logs
2024-01-24 12:25:57 -05:00
Donald Sharp c3a66e5082
Merge pull request #15173 from louis-6wind/nhrp-noarp
nhrpd: unset noarp flag using a zapi message
2024-01-24 10:53:29 -05:00
Donald Sharp 16406a31d3
Merge pull request #15196 from idryzhov/nb-leaf-list
lib: remove leaf-list xpath hack from northbound
2024-01-24 10:49:52 -05:00
Donald Sharp 1ea73983fd
Merge pull request #15209 from opensourcerouting/fix/whitespaces
bgpd: Use single whitespace when displaying show bgp summary
2024-01-24 10:48:22 -05:00
Donald Sharp 8754a64da1
Merge pull request #15189 from opensourcerouting/fix/doc_label-table_json
doc: Add missing json keyword for `show debugging label-table`
2024-01-24 10:47:41 -05:00
Donald Sharp e3e4232102
Merge pull request #15211 from pguibert6WIND/json_compilation_pceplib
pceplib: fix compilation error
2024-01-24 08:50:30 -05:00
Louis Scalbert 6a44127597 nhrpd: remove netlink_configure_arp declaration
Remove the unused netlink_configure_arp() declaration.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-01-24 10:05:52 +01:00
Louis Scalbert 3cd1c34cb7 topotests: nhrp_topo, test absence of noarp flag
Test the absence the NOARP flag on rX-gre0 interfaces. It is present by
default.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-01-24 10:05:49 +01:00
Louis Scalbert bdbea51c98 nhrpd: unset noarp flag using a zapi message
Unset the IFF_NOARP interface flag using a ZAPI message. It removes the
dependency to if.h headers.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-01-24 10:05:29 +01:00
Louis Scalbert 2ee43c873e lib,zebra: add zapi message to control noarp flag
Add a ZAPI message to control the setting of the IFF_NOARP flag.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-01-24 10:05:29 +01:00
Philippe Guibert 838c8857b1 pceplib: fix compilation error
The following compilation error happens, with pcep test files.

> In file included from pceplib/test/pcep_utils_counters_test.c:31:
> pceplib/test/pcep_utils_counters_test.c: In function 'test_create_subgroup_counter':
> pceplib/test/pcep_utils_counters_test.c:127:25: error: too few arguments to function 'create_subgroup_counter'
>   127 |         CU_ASSERT_FALSE(create_subgroup_counter(subgroup, counter_id + 1,
>       |                         ^~~~~~~~~~~~~~~~~~~~~~~
> In file included from pceplib/test/pcep_utils_counters_test.c:33:
> ./pceplib/pcep_utils_counters.h:163:6: note: declared here
>   163 | bool create_subgroup_counter(struct counters_subgroup *subgroup,
>       |      ^~~~~~~~~~~~~~~~~~~~~~~
> Makefile:10948: recipe for target 'pceplib/test/pceplib_test_pcep_utils_tests-pcep_utils_counters_test.o' failed
> make[3]: *** [pceplib/test/pceplib_test_pcep_utils_tests-pcep_utils_counters_test.o] Error 1
> make[3]: *** Waiting for unfinished jobs....

There is a missing parameter.

Fixes: 09047d2bf6 ("pceplib: add json string option to subgroup counter")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-01-24 09:12:35 +01:00
Donatas Abraitis 2c69b4b516 bgpd: Fix format overflow for graceful-restart debug logs
Use enum instead of int, and make the compiler happy when using -format-overflow.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-01-24 09:06:43 +02:00
Donatas Abraitis 03d6a6d137
Merge pull request #15203 from donaldsharp/sharp_neigh_coverity
sharpd: Fix coverity issues
2024-01-24 08:35:33 +02:00
Donald Sharp d1ce73a0fe
Merge pull request #15202 from idryzhov/mgmt-log
mgmtd: remove unguarded debug log
2024-01-23 13:55:44 -05:00
Donatas Abraitis a2ce7f1e4f
Merge pull request #15201 from louis-6wind/fix-rpki-coverity
bgpd: fix RPKI coverity scanner issues
2024-01-23 20:52:53 +02:00
Donatas Abraitis b261464cc1 doc: Drop single whitespace from show bgp outputs
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-01-23 20:42:30 +02:00
Donatas Abraitis a1baf9e84f bgpd: Use single whitespace when displaying show bgp summary
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-01-23 20:41:49 +02:00
Donald Sharp edd4a8571d
Merge pull request #15197 from idryzhov/pim-nb-fix
pimd: fix crash when configuring ssmpingd
2024-01-23 10:37:55 -05:00
Donald Sharp 2703f331e2 sharpd: Fix coverity issues
New commits had an assignment instead of a comparison
option.  Coverity wisely found it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-23 10:28:30 -05:00
Donatas Abraitis 3ab8fc13c1
Merge pull request #15165 from vjardin/ospf_ptmp_unumbered
tests: ospf point-to-multipoint and prefix-suppress
2024-01-23 17:22:28 +02:00
Donatas Abraitis 5435d963b3
Merge pull request #15195 from idryzhov/vtysh-vrf-fix
vtysh: fix VTYSH_VRF definition
2024-01-23 17:20:44 +02:00
Louis Scalbert efdb5f144c bgpd: check sockopt returns in rpki_create_socket
Check (g|s)etsockopt returns in rpki_create_socket(). Coverity scanner
issues 1575916 and 1575924.

Fixes: a951752d4a ("bgpd: create cache server socket in vrf")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-01-23 13:13:13 +01:00
Louis Scalbert a1d4769eca bgpd: fix memory leak in rpki_create_socket
Fix memory leak in rpki_create_socket. Coverity scanner issue 1575914.

Fixes: a951752 ("bgpd: create cache server socket in vrf")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-01-23 13:13:13 +01:00
Louis Scalbert b28fd4e527 bgpd: fix res validity in rpki_create_socket
Fix coverity scanner issue 1575912 where res pointer is supposed to
valid in:

> socket = vrf_socket(res->ai_family, ...)

but is checked for validity a few lines later.

Note that vrf_getaddrinfo returns an error code if getaddrinfo() fails
to allocate res and in this case, rpki_create_socket() returns.

Fixes: a951752 ("bgpd: create cache server socket in vrf")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-01-23 13:12:59 +01:00
Louis Scalbert 39c8c97d41 bgpd: fix deference before check in rpki_create_socket
Fix deference before check coverity scanner issue 1575918 in
rpki_create_socket()

Fixes: a951752d4a ("bgpd: create cache server socket in vrf")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-01-23 12:04:52 +01:00
Louis Scalbert 8c8bb3568a bgpd: fix potential null pointers in rpki
Fix potential NULL pointer in RPKI code. Coverity scanner issues: 1575911
1575913, 1575915, 1575917, 1575919 to 1575923, 1575925 and 1575926.

Fixes: 1420189c11 ("bgpd: add support of rpki in vrf configure context")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-01-23 12:04:49 +01:00
Igor Ryzhov ed57daf60a mgmtd: remove unguarded debug log
The log doesn't provide any valuable information, so removing it instead
of adding a check.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-23 12:36:22 +02:00
Igor Ryzhov a594cda8ce lib: remove leaf-list xpath hack from northbound
Currently, when editing a leaf-list, `nb_candidate_edit` expects to
receive it's xpath without a predicate and the value in a separate
argument, and then creates the full xpath. This hack is complicated,
because it depends on the operation and on the caller being a backend or
not. Instead, let's require to always include the predicate in a
leaf-list xpath. Update all the usages in the code accordingly.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-23 12:33:39 +02:00
Igor Ryzhov 8ffc3640f0 pimd: fix crash when configuring ssmpingd
Command: `ip ssmpingd 1.1.1.1`

Backtrace:
```
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
0x00007fd1d3b02859 in __GI_abort () at abort.c:79
0x00007fd1d3e323e1 in yang_dnode_xpath_get_canon (dnode=<optimized out>, xpath_fmt=<optimized out>, ap=<optimized out>) at lib/yang_wrappers.c:61
0x00007fd1d3e34f41 in yang_dnode_get_ipv4 (addr=addr@entry=0x7ffc368554d4, dnode=<optimized out>, xpath_fmt=xpath_fmt@entry=0x5556af8680d4 "./source-addr") at lib/yang_wrappers.c:826
0x00005556af8216d3 in routing_control_plane_protocols_control_plane_protocol_pim_address_family_ssm_pingd_source_ip_create (args=0x7ffc36855530) at pimd/pim_nb_config.c:925
0x00007fd1d3dec13f in nb_callback_create (nb_node=0x5556b197ea40, nb_node=0x5556b197ea40, errmsg_len=8192, errmsg=0x7ffc36855a90 "", resource=0x5556b18fa6f8, dnode=0x5556b1ad7a10, event=NB_EV_APPLY, context=0x5556b1ad75c0) at lib/northbound.c:1260
nb_callback_configuration (context=0x5556b1ad75c0, event=NB_EV_APPLY, change=<optimized out>, errmsg=0x7ffc36855a90 "", errmsg_len=8192) at lib/northbound.c:1648
0x00007fd1d3deca6c in nb_transaction_process (event=event@entry=NB_EV_APPLY, transaction=transaction@entry=0x5556b1ad75c0, errmsg=errmsg@entry=0x7ffc36855a90 "", errmsg_len=errmsg_len@entry=8192) at lib/northbound.c:1779
0x00007fd1d3decdd6 in nb_candidate_commit_apply (transaction=0x5556b1ad75c0, save_transaction=save_transaction@entry=true, transaction_id=transaction_id@entry=0x0, errmsg=errmsg@entry=0x7ffc36855a90 "", errmsg_len=errmsg_len@entry=8192) at lib/northbound.c:1129
0x00007fd1d3decf15 in nb_candidate_commit (context=..., candidate=<optimized out>, save_transaction=save_transaction@entry=true, comment=comment@entry=0x0, transaction_id=transaction_id@entry=0x0, errmsg=0x7ffc36855a90 "", errmsg_len=8192) at lib/northbound.c:1162
0x00007fd1d3ded4af in nb_cli_classic_commit (vty=vty@entry=0x5556b1ada2a0) at lib/northbound_cli.c:50
0x00007fd1d3df025f in nb_cli_apply_changes_internal (vty=vty@entry=0x5556b1ada2a0, xpath_base=xpath_base@entry=0x7ffc36859b50 ".", clear_pending=clear_pending@entry=false) at lib/northbound_cli.c:177
0x00007fd1d3df06ad in nb_cli_apply_changes (vty=vty@entry=0x5556b1ada2a0, xpath_base_fmt=xpath_base_fmt@entry=0x0) at lib/northbound_cli.c:233
0x00005556af80fdd5 in pim_process_ssmpingd_cmd (vty=0x5556b1ada2a0, operation=NB_OP_CREATE, src_str=0x5556b1ad9630 "1.1.1.1") at pimd/pim_cmd_common.c:3423
0x00007fd1d3da7b0e in cmd_execute_command_real (vline=vline@entry=0x5556b1ac9520, vty=vty@entry=0x5556b1ada2a0, cmd=cmd@entry=0x0, up_level=up_level@entry=0) at lib/command.c:982
0x00007fd1d3da7cb1 in cmd_execute_command (vline=vline@entry=0x5556b1ac9520, vty=vty@entry=0x5556b1ada2a0, cmd=0x0, vtysh=vtysh@entry=0) at lib/command.c:1040
0x00007fd1d3da7e50 in cmd_execute (vty=vty@entry=0x5556b1ada2a0, cmd=cmd@entry=0x5556b1ae0a30 "ip ssmpingd 1.1.1.1", matched=matched@entry=0x0, vtysh=vtysh@entry=0) at lib/command.c:1207
0x00007fd1d3e278be in vty_command (vty=vty@entry=0x5556b1ada2a0, buf=<optimized out>) at lib/vty.c:591
0x00007fd1d3e27afd in vty_execute (vty=0x5556b1ada2a0) at lib/vty.c:1354
0x00007fd1d3e2bb23 in vtysh_read (thread=<optimized out>) at lib/vty.c:2362
0x00007fd1d3e22254 in event_call (thread=thread@entry=0x7ffc3685cd80) at lib/event.c:2003
0x00007fd1d3dce9e8 in frr_run (master=0x5556b183c830) at lib/libfrr.c:1218
0x00005556af803653 in main (argc=6, argv=<optimized out>, envp=<optimized out>) at pimd/pim_main.c:162
```

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-23 11:58:50 +02:00
Donatas Abraitis 92a56d2fa2
Merge pull request #15179 from donaldsharp/zebra_neigh_update
Zebra neigh update
2024-01-23 08:51:26 +02:00
Donatas Abraitis b27f4e2435
Merge pull request #15193 from idryzhov/fix-bgp-rmap-probability
bgpd: fix route-map match probability deconfiguration callback
2024-01-23 08:49:30 +02:00
Christian Hopps 296cda5bc1
Merge pull request #15194 from idryzhov/dist-list-fixes
distribute-list fixes and improvements
2024-01-22 20:44:01 -05:00
Igor Ryzhov 664d14eadb vtysh: fix VTYSH_VRF definition
VTYSH_VRF is a collection of daemon flags, not node flags. The current
code works only because RPKI_VRF_NODE is 1100101 in binary, which
accidentally includes VTYSH_BGPD which is actually needed.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-23 00:17:26 +02:00
Igor Ryzhov 83a698d891 ripngd: use correct autocompletion for distribute-list commands
Currently, we always use access-list autocompletion, even if configuring
prefix-lists. We should differentiate. Also, fix missing "IPv6"
docstring and use correct address family.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-22 23:59:30 +02:00
Igor Ryzhov 45b868a2af ripd: use correct autocompletion for distribute-list commands
Currently, we always use access-list autocompletion, even if configuring
prefix-lists. We should differentiate.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-22 23:59:30 +02:00
Igor Ryzhov aabe9cf377 eigrpd: use correct autocompletion for distribute-list commands
Currently, we always use access-list autocompletion, even if configuring
prefix-lists. We should differentiate. Also, use address-family-specific
autocompletion.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-22 23:59:30 +02:00
Igor Ryzhov 5ab02e99b7 babeld: use correct autocompletion for distribute-list commands
Currently, we always use access-list autocompletion, even if configuring
prefix-lists. We should differentiate.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-22 23:49:39 +02:00
Igor Ryzhov 6dbd2465e1 lib: add address-family-specific autocompletion for prefix-lists
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-22 23:20:31 +02:00
Igor Ryzhov 061c69f3f5 lib: remove global list of distribute-lists
It's not needed anymore, all daemons always pass context.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-22 23:00:43 +02:00
Igor Ryzhov 47aa9fe18c babeld: pass distribute ctx to distribute-list functions
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-22 23:00:18 +02:00
Igor Ryzhov 5a759f8a69 eigrpd: convert distribute-list configuration to northbound
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-22 22:52:50 +02:00
Igor Ryzhov 7006880bc2 bgpd: fix route-map match probability deconfiguration callback
Add missing break. Currently, lib_route_map_entry_match_destroy is
called on every commit stage, but it should run only on APPLY.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-22 22:31:21 +02:00