Philippe Guibert [Wed, 24 Jan 2024 08:10:17 +0000 (09:10 +0100)]
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: 09047d2bf614 ("pceplib: add json string option to subgroup counter") Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Igor Ryzhov [Tue, 23 Jan 2024 00:32:22 +0000 (02:32 +0200)]
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
```
Igor Ryzhov [Mon, 22 Jan 2024 22:17:26 +0000 (00:17 +0200)]
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.
Igor Ryzhov [Mon, 22 Jan 2024 21:44:17 +0000 (23:44 +0200)]
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.
Igor Ryzhov [Mon, 22 Jan 2024 21:21:58 +0000 (23:21 +0200)]
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.
Vincent Jardin [Tue, 16 Jan 2024 22:39:34 +0000 (23:39 +0100)]
tests: ospf point-to-multipoint and suppress
Per the RFC6860, check OSPFv2 using point-to-multipoint
over Ethernet.
Enable the behavior of the RFC6860 using:
ip ospf prefix-suppress A.B.C.D
See:
https://www.rfc-editor.org/rfc/rfc6860#section-2.3.2.2
Note that nexthops are not required to assess the checks.
Igor Ryzhov [Fri, 19 Jan 2024 01:21:53 +0000 (03:21 +0200)]
zebra: fix default value for affinity-mode
- initialize the necessary bit when creating if_link_params
- fix CLI description to mark extended as the default mode
- correctly set mode to extended when using the "no" form of the command
- handle the "show_defaults" parameter correctly in cli_show callback
Igor Ryzhov [Fri, 19 Jan 2024 01:01:40 +0000 (03:01 +0200)]
zebra: remove unnecessary checks from CLI
First, any data tree validation in CLI handler is not correct, because
this code won't be called when the change is done through any other
frontend. Second, these checks are not necessary at all, because NB
layer handles the change between admin-grp/affinity automatically.
Igor Ryzhov [Fri, 19 Jan 2024 00:56:45 +0000 (02:56 +0200)]
zebra: fix link-params admin-grp config output
- it was not printed at all because of the incorrect `yang_dnode_exist`
check
- the intended output was "admin-group" instead of "admin-grp" used in
the actual CLI command
Igor Ryzhov [Thu, 18 Jan 2024 23:40:21 +0000 (01:40 +0200)]
lib: validate affinity-map bit position using the yang model
When affinity mode is "standard", bit position cannot be greater than
31. Add a "must" statement to the YANG model to validate this, and
remove our custom validation code that does the same.
Igor Ryzhov [Thu, 18 Jan 2024 21:27:56 +0000 (23:27 +0200)]
lib: validate affinity-map reference using yang model
Change the type of affinity leaf-list in frr-zebra to a leafref with
"require-instance" property set to true. This change tells libyang to
automatically check that affinity-map exists before usage and doesn't
allow it to be deleted if it's referenced. It allows us to remove all
the manual code that is doing the same thing.
Philippe Guibert [Wed, 10 Jan 2024 14:26:05 +0000 (15:26 +0100)]
pceplib: add json string option to subgroup counter
The created counters in pceplib library are structures with
a string attribute which is used for further display. This
string information is not formatted for json output.
Add a second option in the create_subgroup_counter() creation
API to provide the json attribute output.
Create a json naming compatible with caml format for each
subgroup counter used.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Philippe Guibert [Tue, 29 Oct 2019 16:52:52 +0000 (17:52 +0100)]
bgpd: add a hook to inform a vrf is enabled/disabled
Add a hook to call a future callback function when bgpd knows from zebra
about the activation of de-activation of a VRF. It will be used by the
RPKI module in next commits.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com> Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
RPKI stores its data in global variables. It does not allow specific
date per VRF.
Move global variable to a new structure named rpki_vrf and maintain a
per VRF list of rpki_vrf. The changes are cosmetic because only the
default VRF is supported yet.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com> Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Mark Stapp [Wed, 17 Jan 2024 21:15:07 +0000 (16:15 -0500)]
lib,vtysh: add per-daemon log file config
Add a config that specifies per-deamon log file names.
Move the handy generated list of daemon names from vtysh to lib;
edit the gitignore files to match.