Commit Graph

35139 Commits

Author SHA1 Message Date
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
Rajesh Varatharaj
aa12c72c2a pbrd: Fix PBR handling for last rule deletion
Issue:
Previously, the PBR common was updated for every rule update or deletion

example:
let say we have three rule 11, 12, 13 and if we are removing rule 12. in the current code
we are making the entire map "valid" to false.

pbr-map MAP1 seq 11
match src-ip 90.1.1.2/32
set nexthop 20.1.1.2 swp1

pbr-map MAP1 seq 12
match src-ip 90.1.1.3/32
set nexthop 20.1.1.2 swp1

pbr-map MAP1 seq 13
match src-ip 90.1.1.4/32
set nexthop 20.1.1.2 swp1

no pbr-map MAP1 seq 12 ==> turns whole map valid to false.

r1(config)# end
r1# show pbr map
  pbr-map MAP1 valid: no
    Seq: 11 rule: 310
        Installed: yes Reason: Valid
        SRC IP Match: 90.1.1.2/32
        nexthop 20.1.1.2 swp1
          Installed: yes Tableid: 10002
    Seq: 13 rule: 312
        Installed: yes Reason: Valid
        SRC IP Match: 90.1.1.4/32
        nexthop 20.1.1.2 swp1
          Installed: yes Tableid: 10004

Fix:
Now, the PBR common will only be updated when the last rule is being deleted.
This change ensures that we only send a delete request to Zebra once, and only
set the valid and installed flags to false when the last rule is deleted.
This optimizes the handling of PBR rules and reduces unnecessary interactions with Zebra

Testing: UT in MR notes

Ticket: #
Signed-off-by: Rajesh Varatharaj <rvaratharaj@nvidia.com>
2024-01-23 09:04:34 -08: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
Donald Sharp
01cb1fb82c sharpd: Allow sharpd to listen to neighbor events
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-22 12:19:20 -05:00
Donald Sharp
a0d38a7ac6 lib, nhrpd: Move neighbor reg/unreg to lib/zclient.c
This is needed to be generic.  Let's make it so.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-22 12:14:59 -05:00
Donald Sharp
275edb5c16 *: Rename ZEBRA_NHRP_NEIGH_XXX to ZEBRA_NEIGH_XXX
This does not need to be nhrp specific.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-22 12:14:59 -05:00
Igor Ryzhov
22d1ad786f
Merge pull request #15185 from LabNConsulting/chopps/distlist
add northbound support to distribute-list code.
2024-01-22 16:52:45 +02:00
Donatas Abraitis
20ec72d7ca
Merge pull request #15052 from louis-6wind/rpki-vrf-92
bgpd: add VRF support to RPKI
2024-01-22 16:16:34 +02:00
Christian Hopps
cc9f4029cb ripngd: use new distribute-list northbound code.
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-22 11:33:40 +00:00
Christian Hopps
8f7a9355f2 ripd: use new distribute-list northbound code.
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-22 11:33:33 +00:00
Christian Hopps
a993b8e9bb lib: enable multiple instance support with distribute lists
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-22 11:32:29 +00:00
Christian Hopps
eba64f79cc lib: add northbound support to distribute-list code.
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-22 11:32:29 +00:00
Igor Ryzhov
8664dd9362
Merge pull request #15176 from LabNConsulting/chopps/mgmtd-northbound-fixes
Chopps/mgmtd northbound fixes
2024-01-22 12:48:15 +02:00
Donatas Abraitis
4494680404 doc: Add missing json keyword for show debugging label-table
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-01-21 23:16:38 +02:00
Vincent Jardin
bab32ec8dc 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.

Signed-off-by: Vincent Jardin <vjardin@free.fr>
2024-01-21 21:06:50 +01:00
Donatas Abraitis
7041353fa9
Merge pull request #15125 from pguibert6WIND/srte_pcep_session_json
Dump PCEP session in json format
2024-01-21 21:33:35 +02:00
Donatas Abraitis
f6178ee2e1
Merge pull request #15184 from donaldsharp/zebra_touchups
Zebra touchups
2024-01-21 17:02:26 +02:00
Christian Hopps
dc8f136064 lib: cleanup yang lint warnings
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-21 13:12:26 +00:00
Donatas Abraitis
25c3de18a4
Merge pull request #15178 from donaldsharp/update_unnumbered_doc
doc: Update bgp unnumbered documentation
2024-01-21 13:45:45 +02:00
Donatas Abraitis
19672227ef
Merge pull request #15183 from donaldsharp/zebra_nhg_worms
zebra: Fix NEXTHOP_GROUP_FPM define value
2024-01-21 13:43:35 +02:00