]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
11 months agoMerge pull request #15655 from idryzhov/isis-fix-subtlv-bit
Donatas Abraitis [Mon, 13 May 2024 08:10:38 +0000 (11:10 +0300)]
Merge pull request #15655 from idryzhov/isis-fix-subtlv-bit

isisd: fix ip/ipv6 reachability tlvs

11 months agoMerge pull request #15968 from donaldsharp/parse_attr_problems
Donatas Abraitis [Sat, 11 May 2024 11:44:29 +0000 (14:44 +0300)]
Merge pull request #15968 from donaldsharp/parse_attr_problems

Parse attr problems

11 months agoMerge pull request #15614 from louis-6wind/fix-6pe-address
Donatas Abraitis [Fri, 10 May 2024 19:55:12 +0000 (22:55 +0300)]
Merge pull request #15614 from louis-6wind/fix-6pe-address

bgpd: fix ipv4-mapped ipv6 on non 6pe

11 months agoMerge pull request #15976 from opensourcerouting/build-more-xref-setup
Christian Hopps [Fri, 10 May 2024 14:14:44 +0000 (10:14 -0400)]
Merge pull request #15976 from opensourcerouting/build-more-xref-setup

build: throw in a few more `XREF_SETUP`

11 months agoMerge pull request #15986 from mjstapp/more_rtas
Jafar Al-Gharaibeh [Fri, 10 May 2024 06:22:27 +0000 (01:22 -0500)]
Merge pull request #15986 from mjstapp/more_rtas

zebra: add some more netlink RTA_ strings

11 months agozebra: add some more netlink RTA_ strings
Mark Stapp [Thu, 9 May 2024 20:56:07 +0000 (16:56 -0400)]
zebra: add some more netlink RTA_ strings

Add a few more RTA_ attribute names to the netlink debug
output.

Signed-off-by: Mark Stapp <mjs@cisco.com>
11 months agoMerge pull request #15974 from LabNConsulting/chopps/add-notify-diag
Jafar Al-Gharaibeh [Thu, 9 May 2024 17:02:24 +0000 (12:02 -0500)]
Merge pull request #15974 from LabNConsulting/chopps/add-notify-diag

mgmtd: add missing diagnostic show cmd output (notify maps)

11 months agobuild: throw in a few more `XREF_SETUP`
David Lamparter [Thu, 9 May 2024 05:22:08 +0000 (07:22 +0200)]
build: throw in a few more `XREF_SETUP`

This really should be all of them.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
11 months agozebra: Ensure multipath encodes vxlan right for fpm usage
Donald Sharp [Wed, 8 May 2024 16:52:12 +0000 (12:52 -0400)]
zebra: Ensure multipath encodes vxlan right for fpm usage

The fpm code path for the dplane_fpm_nl module was improperly
encoding the multipath nexthop data for vxlan type routes.
Move this into the embedded nexthop encoding where it belongs.

This change makes it so that the usage of `-M dplane_fpm_nl`
is now producing the same netlink messages that `-M fpm`
produces when using vxlan based nexthops.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
11 months agozebra: Move fpm check to inside of netlink_route_nexthop_encap
Donald Sharp [Wed, 8 May 2024 16:48:12 +0000 (12:48 -0400)]
zebra: Move fpm check to inside of netlink_route_nexthop_encap

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
11 months agozebra: Move netlink_route_nexthop_encap
Donald Sharp [Wed, 8 May 2024 16:46:08 +0000 (12:46 -0400)]
zebra: Move netlink_route_nexthop_encap

Move this static function earlier so we can avoid
a predecleartion.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
11 months agozebra: Add 2 things to fpm_listener
Donald Sharp [Fri, 3 May 2024 15:59:02 +0000 (11:59 -0400)]
zebra: Add 2 things to fpm_listener

1) Add ability to hex-dump the received packet for debugging
2) Receive encap type and vxlan vni and display them.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
11 months agoMerge pull request #15975 from opensourcerouting/pim-fixes-20240508
Jafar Al-Gharaibeh [Thu, 9 May 2024 13:52:11 +0000 (08:52 -0500)]
Merge pull request #15975 from opensourcerouting/pim-fixes-20240508

pimd: fixes split off from #15969

11 months agoMerge pull request #15977 from LabNConsulting/chopps/key-test-fix
Donald Sharp [Thu, 9 May 2024 11:57:40 +0000 (07:57 -0400)]
Merge pull request #15977 from LabNConsulting/chopps/key-test-fix

tests: fix mis-spelled `cryptographic-algorithm` keyword in test

11 months agoMerge pull request #15965 from cscarpitta/bugfix/bgp-srv6-memleaks
Donald Sharp [Thu, 9 May 2024 11:11:56 +0000 (07:11 -0400)]
Merge pull request #15965 from cscarpitta/bugfix/bgp-srv6-memleaks

bgpd: Fix SRv6 memory leaks spotted by Address Sanitizer

11 months agoMerge pull request #15967 from opensourcerouting/fix/drop_redundand_variable
Donald Sharp [Thu, 9 May 2024 11:11:01 +0000 (07:11 -0400)]
Merge pull request #15967 from opensourcerouting/fix/drop_redundand_variable

bgpd: Remove redundant recursion flag variable

11 months agoMerge pull request #15972 from opensourcerouting/clang-ignore-defuns
Donald Sharp [Thu, 9 May 2024 11:09:48 +0000 (07:09 -0400)]
Merge pull request #15972 from opensourcerouting/clang-ignore-defuns

build: make clang-format ignore DEFUN/DEFPY

11 months agotests: fix mis-spelled `cryptographic-algorithm` keyword in test
Christian Hopps [Thu, 9 May 2024 08:19:44 +0000 (04:19 -0400)]
tests: fix mis-spelled `cryptographic-algorithm` keyword in test

Also update to use a newer hashing function while we are here.

fixes #15923

Signed-off-by: Christian Hopps <chopps@labn.net>
11 months agobgpd: Move SRv6 cleanup functions
Carmine Scarpitta [Wed, 8 May 2024 07:48:55 +0000 (09:48 +0200)]
bgpd: Move SRv6 cleanup functions

Move SRv6 cleanup operations to `bgp_srv6_cleanup` function.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
11 months agobgpd: Fix SRv6 memory leaks spotted by ASAN
Carmine Scarpitta [Wed, 8 May 2024 07:45:56 +0000 (09:45 +0200)]
bgpd: Fix SRv6 memory leaks spotted by ASAN

Fix a couple of memory leaks spotted by Address Sanitizer:

```

=================================================================
==970960==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 592 byte(s) in 2 object(s) allocated from:
    #0 0xfeb98b28a4b4 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
    #1 0xfeb98ae572f8 in qcalloc lib/memory.c:105
    #2 0xfeb98ae76138 in srv6_locator_chunk_alloc lib/srv6.c:138
    #3 0xb7f3c8508fa0 in ensure_vrf_tovpn_sid_per_vrf bgpd/bgp_mplsvpn.c:831
    #4 0xb7f3c8509494 in ensure_vrf_tovpn_sid bgpd/bgp_mplsvpn.c:866
    #5 0xb7f3c85028a8 in vpn_leak_postchange bgpd/bgp_mplsvpn.h:289
    #6 0xb7f3c851a7c0 in vpn_leak_postchange_all bgpd/bgp_mplsvpn.c:3769
    #7 0xb7f3c86f6ef0 in bgp_zebra_process_srv6_locator_chunk bgpd/bgp_zebra.c:3378
    #8 0xfeb98afa6e14 in zclient_read lib/zclient.c:4608
    #9 0xfeb98af3d684 in event_call lib/event.c:2011
    #10 0xfeb98ae2788c in frr_run lib/libfrr.c:1217
    #11 0xb7f3c83cbf0c in main bgpd/bgp_main.c:545
    #12 0xfeb98a8973f8 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    #13 0xfeb98a8974c8 in __libc_start_main_impl ../csu/libc-start.c:392
    #14 0xb7f3c83c832c in _start (/usr/lib/frr/bgpd+0x2d832c)

Direct leak of 32 byte(s) in 2 object(s) allocated from:
    #0 0xfeb98b28a4b4 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
    #1 0xfeb98ae572f8 in qcalloc lib/memory.c:105
    #2 0xb7f3c8508fd8 in ensure_vrf_tovpn_sid_per_vrf bgpd/bgp_mplsvpn.c:832
    #3 0xb7f3c8509494 in ensure_vrf_tovpn_sid bgpd/bgp_mplsvpn.c:866
    #4 0xb7f3c85028a8 in vpn_leak_postchange bgpd/bgp_mplsvpn.h:289
    #5 0xb7f3c851a7c0 in vpn_leak_postchange_all bgpd/bgp_mplsvpn.c:3769
    #6 0xb7f3c86f6ef0 in bgp_zebra_process_srv6_locator_chunk bgpd/bgp_zebra.c:3378
    #7 0xfeb98afa6e14 in zclient_read lib/zclient.c:4608
    #8 0xfeb98af3d684 in event_call lib/event.c:2011
    #9 0xfeb98ae2788c in frr_run lib/libfrr.c:1217
    #10 0xb7f3c83cbf0c in main bgpd/bgp_main.c:545
    #11 0xfeb98a8973f8 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    #12 0xfeb98a8974c8 in __libc_start_main_impl ../csu/libc-start.c:392
    #13 0xb7f3c83c832c in _start (/usr/lib/frr/bgpd+0x2d832c)

Direct leak of 32 byte(s) in 2 object(s) allocated from:
    #0 0xfeb98b28a4b4 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
    #1 0xfeb98ae572f8 in qcalloc lib/memory.c:105
    #2 0xb7f3c8506520 in vpn_leak_zebra_vrf_sid_update_per_vrf bgpd/bgp_mplsvpn.c:439
    #3 0xb7f3c85068d8 in vpn_leak_zebra_vrf_sid_update bgpd/bgp_mplsvpn.c:459
    #4 0xb7f3c86f6aec in bgp_ifp_create bgpd/bgp_zebra.c:3345
    #5 0xfeb98adfd3f8 in hook_call_if_real lib/if.c:48
    #6 0xfeb98adfe750 in if_new_via_zapi lib/if.c:181
    #7 0xfeb98af98084 in zclient_interface_add lib/zclient.c:2592
    #8 0xfeb98afa6d24 in zclient_read lib/zclient.c:4606
    #9 0xfeb98af3d684 in event_call lib/event.c:2011
    #10 0xfeb98ae2788c in frr_run lib/libfrr.c:1217
    #11 0xb7f3c83cbf0c in main bgpd/bgp_main.c:545
    #12 0xfeb98a8973f8 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    #13 0xfeb98a8974c8 in __libc_start_main_impl ../csu/libc-start.c:392
    #14 0xb7f3c83c832c in _start (/usr/lib/frr/bgpd+0x2d832c)

SUMMARY: AddressSanitizer: 656 byte(s) leaked in 6 allocation(s).

```

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
11 months agomgmtd: add missing diagnostic show cmd output (notify maps)
Christian Hopps [Thu, 9 May 2024 04:15:58 +0000 (00:15 -0400)]
mgmtd: add missing diagnostic show cmd output (notify maps)

- also add missing rpc client accounting bug in same diagnostic command.

Signed-off-by: Christian Hopps <chopps@labn.net>
11 months agobuild: make clang-format ignore DEFUN/DEFPY
David Lamparter [Wed, 8 May 2024 19:47:14 +0000 (21:47 +0200)]
build: make clang-format ignore DEFUN/DEFPY

This makes clang-format not wreck all our hand-formatted DEFUN/DEFPY
statements.  We apparently missed this option when we originally looked
at setting up the .clang-format control file...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
11 months agoMerge pull request #15920 from chiragshah6/fdev2
Donatas Abraitis [Wed, 8 May 2024 19:36:58 +0000 (22:36 +0300)]
Merge pull request #15920 from chiragshah6/fdev2

zebra: fix EVPN svd based remote nh neigh del

11 months agopimd: fix order of operations for evaluating join
David Lamparter [Mon, 12 Dec 2022 16:50:59 +0000 (17:50 +0100)]
pimd: fix order of operations for evaluating join

join_desired looks at whether up->channel_oil is empty.  up->channel_oil
is updated from pim_forward_stop(), calling pim_channel_del_oif().  But
that was being called *after* updating join_desired, so join_desired saw
a non-empty OIL.  Pull up the pim_forward_stop() call to before updating
join_desired.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
11 months agopimd: fix null register before aging out reg-stop
David Lamparter [Mon, 17 Apr 2023 09:47:08 +0000 (11:47 +0200)]
pimd: fix null register before aging out reg-stop

It looks like the code was trying to do this with the null_register
parameter on pim_upstream_start_register_stop_timer(), but that didn't
quite work right.  Restructure a bit to get it right.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
11 months agopimd: fix dr-priority range
David Lamparter [Fri, 14 Apr 2023 15:17:27 +0000 (17:17 +0200)]
pimd: fix dr-priority range

0 is a valid DR priority.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
11 months agoMerge pull request #15946 from LabNConsulting/chopps/rpc-cleanup
Mark Stapp [Wed, 8 May 2024 15:14:55 +0000 (11:14 -0400)]
Merge pull request #15946 from LabNConsulting/chopps/rpc-cleanup

mgmtd RPC minor cleanup

11 months agobgpd: Remove redundant recursion flag variable
Donatas Abraitis [Wed, 8 May 2024 14:02:15 +0000 (17:02 +0300)]
bgpd: Remove redundant recursion flag variable

Reuse an existing one.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
11 months agoMerge pull request #15962 from opensourcerouting/zmq-xref-setup
Donald Sharp [Wed, 8 May 2024 13:56:12 +0000 (09:56 -0400)]
Merge pull request #15962 from opensourcerouting/zmq-xref-setup

lib: stick `XREF_SETUP` into libfrrzmq

11 months agoMerge pull request #15942 from anlancs/isisd/doc-flex
Russ White [Wed, 8 May 2024 12:35:42 +0000 (08:35 -0400)]
Merge pull request #15942 from anlancs/isisd/doc-flex

doc: fix one command for isis

11 months agoMerge pull request #15950 from mxyns/draft-bmp-peer-up
Donatas Abraitis [Wed, 8 May 2024 11:50:26 +0000 (14:50 +0300)]
Merge pull request #15950 from mxyns/draft-bmp-peer-up

bgpd: bmp rename tlv types

11 months agoMerge pull request #15608 from vjardin/libyang3
Martin Winter [Wed, 8 May 2024 10:48:03 +0000 (12:48 +0200)]
Merge pull request #15608 from vjardin/libyang3

libyang3 - fondation step 1

11 months agodebian: libyang3
Vincent JARDIN [Fri, 3 May 2024 17:01:27 +0000 (19:01 +0200)]
debian: libyang3

libyang3-dev is required.

TODO: add redhat, snapcraft

Suggested-by: Martin Winter <mwinter@opensourcerouting.org>
Signed-off-by: Vincent Jardin <vjardin@free.fr>
11 months agolib: libyang.so.3 compatibilty layers
Vincent JARDIN [Sun, 7 Apr 2024 10:27:20 +0000 (12:27 +0200)]
lib: libyang.so.3 compatibilty layers

Let's support libyang 2.2.8 using libyang.so.3.0.8
It requires the commit ed277585ea from the libyang.

Signed-off-by: Vincent Jardin <vjardin@free.fr>
11 months agolib: stick `XREF_SETUP` into libfrrzmq
David Lamparter [Tue, 7 May 2024 21:07:42 +0000 (23:07 +0200)]
lib: stick `XREF_SETUP` into libfrrzmq

Didn't catch this one when adding the warning/error (with -Werror) for
missing this.  Neither the CI nor I build with ZeroMQ enabled :(.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
11 months agoMerge pull request #15885 from opensourcerouting/gcc-unrecognized-ms-anon-tag
Donald Sharp [Tue, 7 May 2024 20:00:53 +0000 (16:00 -0400)]
Merge pull request #15885 from opensourcerouting/gcc-unrecognized-ms-anon-tag

build: get rid of "unrecognized … anon-tag"

11 months agoMerge pull request #15947 from anlancs/isisd/fix-lsp-json
Russ White [Tue, 7 May 2024 15:29:46 +0000 (11:29 -0400)]
Merge pull request #15947 from anlancs/isisd/fix-lsp-json

isisd: fix json display for database command

11 months agoMerge pull request #15627 from Max-Mustermann33/ospf6d_metric_for_type5_lsa
Russ White [Tue, 7 May 2024 15:01:12 +0000 (11:01 -0400)]
Merge pull request #15627 from Max-Mustermann33/ospf6d_metric_for_type5_lsa

ospf6d: Fix metric when sending AS-external LSAs

11 months agoMerge pull request #15922 from anlancs/isisd/fix-unnecessary-check-vrf-cleanup
Russ White [Tue, 7 May 2024 15:00:14 +0000 (11:00 -0400)]
Merge pull request #15922 from anlancs/isisd/fix-unnecessary-check-vrf-cleanup

isisd: remove unnecessary checkings for vrf

11 months agoMerge pull request #15944 from lsang6WIND/fix-same-prefix
Russ White [Tue, 7 May 2024 14:57:56 +0000 (10:57 -0400)]
Merge pull request #15944 from lsang6WIND/fix-same-prefix

if: fix same connected address

11 months agoMerge pull request #15945 from anlancs/isisd/fix-topology-algorithm-show
Russ White [Tue, 7 May 2024 14:57:33 +0000 (10:57 -0400)]
Merge pull request #15945 from anlancs/isisd/fix-topology-algorithm-show

isisd: fix the display topology command

11 months agomgmtd: some cleanup from original RPC commit
Christian Hopps [Tue, 7 May 2024 02:40:27 +0000 (02:40 +0000)]
mgmtd: some cleanup from original RPC commit

- Fix memleak on multiple errstr returns (multiple clients) Allow the
- multiple clients to all return results and merge them (as with other
  operations like get tree).

Signed-off-by: Christian Hopps <chopps@labn.net>
11 months agoMerge pull request #15913 from opensourcerouting/fix/bgpd_no_set_as_prepend
Russ White [Tue, 7 May 2024 14:51:48 +0000 (10:51 -0400)]
Merge pull request #15913 from opensourcerouting/fix/bgpd_no_set_as_prepend

bgpd: Fix `no set as-path prepend ASNUM...`

11 months agoMerge pull request #15899 from gromit1811/ospf6_ecmp_inter_area_bugfix_15777_pr
Russ White [Tue, 7 May 2024 14:48:32 +0000 (10:48 -0400)]
Merge pull request #15899 from gromit1811/ospf6_ecmp_inter_area_bugfix_15777_pr

ospf6d: Fix nexthop computation for inter-area multi-ABR ECMP

11 months agoMerge pull request #15895 from opensourcerouting/fix/ignore_attributes_if_discard_is_...
Russ White [Tue, 7 May 2024 14:44:38 +0000 (10:44 -0400)]
Merge pull request #15895 from opensourcerouting/fix/ignore_attributes_if_discard_is_configured

bgpd: Ignore validating the attribute flags if path-attribute is configured

11 months agodoc: fix one command for isis
anlan_cs [Mon, 6 May 2024 12:38:57 +0000 (20:38 +0800)]
doc: fix one command for isis

Correct one command for isis based on code. And better the web page.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
11 months agoMerge pull request #15846 from Shbinging/fix_ip_ospf_dead_interval_fast_hello
Russ White [Tue, 7 May 2024 13:58:29 +0000 (09:58 -0400)]
Merge pull request #15846 from Shbinging/fix_ip_ospf_dead_interval_fast_hello

ospfd: fix the bug where ip_ospf_dead-interval_minimal_hello-multiplier did not reset hello timer

11 months agoMerge pull request #15883 from opensourcerouting/fix/bgpd_gr_fsm
Russ White [Tue, 7 May 2024 13:56:51 +0000 (09:56 -0400)]
Merge pull request #15883 from opensourcerouting/fix/bgpd_gr_fsm

bgpd: Apply NOOP when doing negative commands for GR operations

11 months agobgpd: bmp rename tlv types
Maxence Younsi [Tue, 7 May 2024 11:15:31 +0000 (13:15 +0200)]
bgpd: bmp rename tlv types

renamed BMP_INFO_TYPE_SYSDESCR to BMP_INIT_INFO_TYPE_SYSDESCR
renamed BMP_INFO_TYPE_SYSNAME to BMP_INIT_INFO_TYPE_SYSNAME
added BMP_PEERUP_INFO_STRING

Signed-off-by: Maxou <maxence.younsi@insa-lyon.fr>
11 months agoisisd: fix json display for database command
anlan_cs [Tue, 7 May 2024 02:16:00 +0000 (10:16 +0800)]
isisd: fix json display for database command

The current json display lost a lot of LSPs, added them.

Fixed the json format for two commands:
"show isis database detail json"
"show isis database json"

Signed-off-by: anlan_cs <anlan_cs@tom.com>
11 months agomgmtd: rpc and action handling both should use rpc map.
Christian Hopps [Tue, 7 May 2024 02:37:52 +0000 (02:37 +0000)]
mgmtd: rpc and action handling both should use rpc map.

The previous idea of using config xpath registrations for actions b/c
the config is the subject of the action is sub-optimal. It splits
handling of YANG "actions" (Action and RPCs) between 2 different
registartion maps for the same category of functionality.

Signed-off-by: Christian Hopps <chopps@labn.net>
11 months agoisisd: fix the display topology command
anlan_cs [Tue, 7 May 2024 01:08:05 +0000 (09:08 +0800)]
isisd: fix the display topology command

The unconfigured flexible algorithm should not be displayed.

Before:
```
anlan# show isis topology algorithm
Area A: Algorithm 128

Area A:Area A:Area A:Area A:Area A:Area A:Area A:Area A:Area A:Area ...
......
anlan#
```

After:
```
anlan# show isis topology algorithm
Area A: Algorithm 128

anlan#
```

Signed-off-by: anlan_cs <anlan_cs@tom.com>
11 months agoMerge pull request #15594 from idryzhov/mgmt-rpc
Christian Hopps [Mon, 6 May 2024 20:05:50 +0000 (16:05 -0400)]
Merge pull request #15594 from idryzhov/mgmt-rpc

mgmtd: implement YANG RPC/action support

11 months agoif: fix same connected address
Loïc Sang [Mon, 6 May 2024 15:30:01 +0000 (17:30 +0200)]
if: fix same connected address

Using the same address with a different prefix length is not supported.
If we configure two identical addresses with different
netmasks 192.168.1.1/30 and then 192.168.1.1/29. Zebra sends
'192.168.1.1' with a prefix length of 29. However, the function
'zebra_interface_address_read()' reads '192.168.1.1/30' because the
prefix length is not checked.

Using 'same_prefix()' is more convenient.

Signed-off-by: Loïc Sang <loic.sang@6wind.com>
11 months agoMerge pull request #15902 from opensourcerouting/build-xref-setup-hppa
Donald Sharp [Mon, 6 May 2024 14:29:05 +0000 (10:29 -0400)]
Merge pull request #15902 from opensourcerouting/build-xref-setup-hppa

build: fix missing `XREF_SETUP` (and HP PA-RISC build failure)

11 months agoMerge pull request #15889 from opensourcerouting/build-libatomic
Donald Sharp [Mon, 6 May 2024 14:27:33 +0000 (10:27 -0400)]
Merge pull request #15889 from opensourcerouting/build-libatomic

build: link libatomic if available

11 months agoMerge pull request #15915 from opensourcerouting/build-format-suseconds
Donald Sharp [Mon, 6 May 2024 14:26:46 +0000 (10:26 -0400)]
Merge pull request #15915 from opensourcerouting/build-format-suseconds

lib, gcc-plugin: fix 64-bit time_t prints

11 months agoMerge pull request #15924 from chiragshah6/fdev5
Donatas Abraitis [Mon, 6 May 2024 07:12:27 +0000 (10:12 +0300)]
Merge pull request #15924 from chiragshah6/fdev5

bgpd: [GR] fix mode change vtysh return code

11 months agoospf6d: Redistribute metric for AS-external route
Alexander Rose [Thu, 11 Apr 2024 11:07:33 +0000 (13:07 +0200)]
ospf6d: Redistribute metric for AS-external route

When ospf6d originates an AS-external route that has been read from a kernel
routing table, then the metric of that route was ignored until now.
If a routemap is configured, then this metric will be redistributed from
now on.

Using metric increment and decrement in routemaps is supported by ospf6d now.

Signed-off-by: Alexander Rose <alexander.rose@secunet.com>
11 months agoMerge pull request #15921 from cscarpitta/bgp-fix-srv6-locator-delete-crash
Donatas Abraitis [Mon, 6 May 2024 05:51:24 +0000 (08:51 +0300)]
Merge pull request #15921 from cscarpitta/bgp-fix-srv6-locator-delete-crash

bgpd: Fix crash when deleting the SRv6 locator

11 months agoisisd: remove unnecessary check for vrf
anlan_cs [Sat, 4 May 2024 14:56:21 +0000 (22:56 +0800)]
isisd: remove unnecessary check for vrf

The `vrf_name` is always non-NULL in `isisd` code, so remove the
unnecesary check to make it clear.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
11 months agobgpd: Fix the order of NULL check and ZAPI decode
Carmine Scarpitta [Sun, 5 May 2024 05:25:57 +0000 (07:25 +0200)]
bgpd: Fix the order of NULL check and ZAPI decode

When BGP receives an SRV6_LOCATOR_ADD message from zebra, it calls the
`bgp_zebra_process_srv6_locator_add()` function to process the message.
`bgp_zebra_process_srv6_locator_add()` decodes the message first, and
then if the pointer to the default BGP instance is NULL (i.e. the
default BGP instance is not configured yet), it returns early without
doing anything and without using the decoded message information.

This commit fixes the order of the operations executed by
`bgp_zebra_process_srv6_locator_add()`. We first ensure that the default
BGP instance is ready and we return early if it is not. Then, we decode
the message and do something with the information contained in it.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
11 months agobgpd: [GR] fix mode change vtysh return code
Chirag Shah [Fri, 2 Feb 2024 20:11:58 +0000 (12:11 -0800)]
bgpd: [GR] fix mode change vtysh return code

When a bgp neighbor graceful-restart config mode change
is applied, after accepting the config if it does not
take effect instead of throwing vtysh error code,
return the success to vtysh and warn the user.
The debug log is already present at critical code point
where GR failure is seen during config apply.

Ticket: #3761481
Testing Done:

root@tor-1:# vtysh -c 'config t' -c 'router bgp 65564
vrf VRF2' -c 'neighbor 20.1.1.1 graceful-restart'
As part of configuring graceful-restart, capability send to zebra failed
root@tor-1:# echo $?
0

Signed-off-by: Chirag Shah <chirag@nvidia.com>
11 months agoMerge pull request #15917 from anlancs/isisd/fix-display-route
Donatas Abraitis [Sat, 4 May 2024 09:30:17 +0000 (12:30 +0300)]
Merge pull request #15917 from anlancs/isisd/fix-display-route

isisd: adjust the format of display command

11 months agoMerge pull request #15607 from chiragshah6/evpn_dev4
Donatas Abraitis [Sat, 4 May 2024 06:08:04 +0000 (09:08 +0300)]
Merge pull request #15607 from chiragshah6/evpn_dev4

zebra: bridge flap handle vlan membership update

11 months agobgpd: Fix crash when deleting the SRv6 locator
Carmine Scarpitta [Fri, 3 May 2024 21:35:05 +0000 (23:35 +0200)]
bgpd: Fix crash when deleting the SRv6 locator

When BGP receives a `SRV6_LOCATOR_DEL` from zebra, it invokes
`bgp_zebra_process_srv6_locator_delete` to process the message.

`bgp_zebra_process_srv6_locator_delete` obtains a pointer to the default
BGP instance and then dereferences this pointer.

If the default BGP instance is not ready / not configured yet, this
pointer this pointer is `NULL` and dereferencing it causes BGP to crash.

This commit fix the issue by adding a a check to verify if the pointer
is `NULL` and returning early if it is.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
11 months agozebra: fix EVPN svd based remote nh neigh del
Chirag Shah [Fri, 3 May 2024 03:58:50 +0000 (20:58 -0700)]
zebra: fix EVPN svd based remote nh neigh del

In the context of SVD (Single VxLAN Device) for L3VNI,
the remote VTEP's nexthop is programmed neighbor entry against
SVD along with neighbor entry against SVI.

However, when L3VNI is removed or the VRF is disabled, all SVI
based remote nexthop neighbors are uninstalled and deleted.
The SVD based neigh entries remains in Zebra and the Kernel.
Subsequently, when reconfiguring L3VNI and relearning the same nexthop,
the neighbor entry is not programmed is because it is not removed
from Zebra SVD neighbor hash table, leading to the failure to
reprogram the entry.

With this fix, the SVD nexthop neigh entry is uninstalled
and deleted from Zebra and Kernel.

Ticket: #3729045

Testing:

borderleaf:# ip neigh show 2.2.2.2
2.2.2.2 dev vlan2560_l3 lladdr 00:01:00:00:1d:09 extern_learn NOARP proto zebra
2.2.2.2 dev vxlan99 lladdr 00:01:00:00:1d:09 extern_learn NOARP proto zebra

With the fix:

Zebra log shows both enties SVD (vxlan99) and SVI (vlan2560_l3)
neighbor entries are deleted.

2024/05/03 18:41:33.527125 ZEBRA: [NH6N7-54CD1] Tx RTM_DELNEIGH family
ipv4 IF vxlan99(16) Neigh 2.2.2.2 MAC  null flags 0x10 state 0x0
ext_flags 0x0
2024/05/03 18:41:33.527128 ZEBRA: [NH6N7-54CD1] Tx RTM_DELNEIGH family
ipv4 IF vlan2560_l3(18) Neigh 2.2.2.2 MAC  null flags 0x10 state 0x0
ext_flags 0x0

borderleaf:# ip neigh show 2.2.2.2
borderleaf:#

Signed-off-by: Chirag Shah <chirag@nvidia.com>
11 months agozebra: bridge flap handle vlan membership update
Chirag Shah [Fri, 22 Mar 2024 20:25:18 +0000 (13:25 -0700)]
zebra: bridge flap handle vlan membership update

Upon bridge flap, the associated SVD case,
VLAN membership is not updated correctly.
When SVI comes up, the VNI could not associate
with it as bridge VLAN membership was not updated.

Ticket: #3821632

Testing:

Before fix:
-----------
tor-1:#ifdown br_l3vni ; sleep 1 ; ifup br_l3vni
tor-1:# vtysh -c 'show evpn vni 8888'
VNI: 8888
  Type: L3
  Tenant VRF: sym_1
  Vlan: 490
  Bridge: br_l3vni
  Local Vtep Ip: 27.0.0.9
  Vxlan-Intf: vxlan99
  SVI-If: None    <<<<<< SVI not found
  State: Down     <<<<<< status remained in down BGP is not informed
  VNI Filter: none
  System MAC: None
  Router MAC: None
  L2 VNIs: 1800 1801 1900 1901

After fix:
----------

tor-1:# ifdown br_l3vni; sleep 1; ifup br_l3vni
tor-1:# vtysh

Hello, this is FRRouting (version 8.4.3).
Copyright 1996-2005 Kunihiro Ishiguro, et al.

tor-1# show evpn vni 8888
VNI: 8888
  Type: L3
  Tenant VRF: sym_1
  Vlan: 490
  Bridge: br_l3vni
  Local Vtep Ip: 27.0.0.9
  Vxlan-Intf: vxlan99
  SVI-If: vlan490_l3 <<<<<<
  State: Up          <<<<<<
  VNI Filter: none
  System MAC: 44:38:39:ff:ff:29
  Router MAC: 44:38:39:ff:ff:29
  L2 VNIs: 1800 1801 1900 1901

Signed-off-by: Chirag Shah <chirag@nvidia.com>
11 months agoisisd: adjust the format of display command
anlan_cs [Fri, 3 May 2024 15:04:05 +0000 (23:04 +0800)]
isisd: adjust the format of display command

Before:
```
anlan# show isis neighbor
Area xx:
  System Id           Interface   L  State        Holdtime SNPA
 0023.0000.0000      enp1s0      2  Down          Expiring2c53.4a30.0820
```

After:
```
anlan# show isis neighbor
Area xx:
 System Id           Interface   L  State         Holdtime SNPA
 0023.0000.0000      enp1s0      2  Down          Expiring 2c53.4a30.0820
```

The `-` display format caused by no hello packet in `isis_adj_print_vty()`
is same as that of above "Expiring".

Signed-off-by: anlan_cs <anlan_cs@tom.com>
11 months agoMerge pull request #15914 from opensourcerouting/build-deprecated-no-error
Donald Sharp [Fri, 3 May 2024 14:48:20 +0000 (10:48 -0400)]
Merge pull request #15914 from opensourcerouting/build-deprecated-no-error

build: exclude deprecated decls from -Werror

11 months agoMerge pull request #15904 from LabNConsulting/chopps/remsleep
Donald Sharp [Fri, 3 May 2024 14:37:47 +0000 (10:37 -0400)]
Merge pull request #15904 from LabNConsulting/chopps/remsleep

tests: remove reliance on time.sleep

11 months agobuild: get rid of "unrecognized … anon-tag"
David Lamparter [Tue, 30 Apr 2024 11:51:38 +0000 (13:51 +0200)]
build: get rid of "unrecognized … anon-tag"

GCC only errors out on unrecognized _positive_ `-Wsomething` flags,
negative ones it ignores... but then prints a "note" about whenever an
unrelated(!) warning/error occurs.  This is both annoying and confusing,
since we now get a lot of:

```
cc1: note: unrecognized command-line option ‘-Wno-microsoft-anon-tag’ may have been intended to silence earlier diagnostics
```

Fix by checking for the positive flag in `AC_C_FLAG` instead, which will
error out, and therefore `-Wno-microsoft-anon-tag` won't be added for
GCC.  (It only exists on clang.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
11 months agoMerge pull request #15901 from anlancs/zebra/fix-one-comment
Donatas Abraitis [Fri, 3 May 2024 08:09:29 +0000 (11:09 +0300)]
Merge pull request #15901 from anlancs/zebra/fix-one-comment

zebra: clean up one comment

11 months agotests: Modify inter-area ECMP topotest to also test redundant ABRs
Martin Buck [Mon, 22 Apr 2024 11:01:22 +0000 (13:01 +0200)]
tests: Modify inter-area ECMP topotest to also test redundant ABRs

So far, this test only convered redundant paths to one ABR, now it checks
redundant paths to redundant ABRs, covering both cases. Useful as a
regression test for #15777.

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
11 months agoospf6d: Fix nexthop computation for inter-area multi-ABR ECMP
Martin Buck [Mon, 22 Apr 2024 15:13:23 +0000 (17:13 +0200)]
ospf6d: Fix nexthop computation for inter-area multi-ABR ECMP

Pre-b74e965, we always merged nexthops of old (existing) and new (newly
generated, based on a LSA update) routes, making it impossible to remove
individual nexthops from a route. b74e965 replaced this by copying nexthops
from the new route to the old route. This works as long as the old and new
route are derived from the same LSA (e.g. multiple ECMP paths to the same
ABR). However, in case of multiple parallel ABRs, each of them originates a
LSA and the nexthops derived from them need to be combined to get the proper
route nexthops. So instead of trying to incrementally update the route
nexthops based on the old and new route nexthops, always recompute the route
nexthops by merging all of its path nexthops (which we're already updating
based on the LSA being processed).

Fixes #15777.

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
11 months agobgpd: Allow using optional table id for negative `no set table X` command
Donatas Abraitis [Fri, 3 May 2024 05:58:21 +0000 (08:58 +0300)]
bgpd: Allow using optional table id for negative `no set table X` command

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
11 months agobuild: hppa is weird
David Lamparter [Thu, 2 May 2024 09:00:17 +0000 (11:00 +0200)]
build: hppa is weird

hppa (yes, HP PA-RISC) apparently creates relocations that refer to
".init+0x12345" for everything, referencing way past the end of the
.init section.  While this is only fallback code hit when XREF_SETUP()
is missing (i.e. the FRRouting.XREF ELF note is absent), try to make it
work anyway.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
11 months agobuild: warn/fail on missing `XREF_SETUP()`
David Lamparter [Thu, 2 May 2024 08:57:31 +0000 (10:57 +0200)]
build: warn/fail on missing `XREF_SETUP()`

While clippy tries really, really hard to work under adverse conditions,
and this catches missing XREF_SETUP() on almost all CPU architectures,
this doesn't quite work on hppa.  So, make it a warning on *all*
platforms (or error for --enable-dev-build) in order to catch it before
shipping off to Debian's buildd and blowing up there...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
11 months ago*: add XREF_SETUP() to libraries and utilites
David Lamparter [Thu, 2 May 2024 08:55:11 +0000 (10:55 +0200)]
*: add XREF_SETUP() to libraries and utilites

This is theoretically not needed if neither DEFUNs nor zlog_* calls are
used, except I'm about to turn it into a build error to catch the cases
where it _is_ necessary.  Which is libmgmt_be_nb.la in this case, where
it causes build failures on hppa.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
11 months agobgpd: Fix `no set as-path prepend ASNUM...`
Donatas Abraitis [Thu, 2 May 2024 20:07:19 +0000 (23:07 +0300)]
bgpd: Fix `no set as-path prepend ASNUM...`

If entering `no set as-path prepend 1 2 3`, it's warned as unknown command.

Now fixed, and the following combinations work fine:

```
no set as-path prepend
no set as-path prepend last-as
no set as-path prepend last-as 1
no set as-path prepend 1
no set as-path prepend 1 2
```

Fixes: https://github.com/FRRouting/frr/issues/15912
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
11 months agotools/gcc-plugins: warn for `suseconds_t` format
David Lamparter [Tue, 30 Apr 2024 12:13:22 +0000 (14:13 +0200)]
tools/gcc-plugins: warn for `suseconds_t` format

The plugin was already catching attempts to print `time_t` without
casting it first (there is no valid printf specifier without a cast),
but `__suseconds64_t` needs the same treatment.  (Probably
`__suseconds_t` too, if it exists, which I'm not sure it does - but that
doesn't matter, the plugin ignores non-existing types.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
11 months agolib: fix `time_t` print without cast
David Lamparter [Tue, 30 Apr 2024 12:18:03 +0000 (14:18 +0200)]
lib: fix `time_t` print without cast

The gcc plugin wasn't warning about printing `suseconds_t` (which is
`time_t`, but in `struct timeval`.)  It needs to be printed with a cast,
just like `time_t`.  Luckily there is only one such usage.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
11 months agoMerge pull request #15837 from acooks-at-bda/dev/fix-deprecated-cares-api
David Lamparter [Thu, 2 May 2024 20:26:16 +0000 (22:26 +0200)]
Merge pull request #15837 from acooks-at-bda/dev/fix-deprecated-cares-api

11 months agobuild: exclude deprecated decls from -Werror
David Lamparter [Thu, 2 May 2024 20:07:24 +0000 (22:07 +0200)]
build: exclude deprecated decls from -Werror

Other parts of the system can change (e.g. libc-ares), making things
deprecated, and then our build fails for no reason inside FRR.  This
shouldn't be an error.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
11 months agoMerge pull request #15840 from opensourcerouting/ospf6-iftype-connected-fix
Donald Sharp [Thu, 2 May 2024 14:22:11 +0000 (10:22 -0400)]
Merge pull request #15840 from opensourcerouting/ospf6-iftype-connected-fix

ospf6d: fix interface type vs. connected routes updates

11 months agotests: remove reliance on time.sleep
Christian Hopps [Thu, 2 May 2024 10:09:42 +0000 (06:09 -0400)]
tests: remove reliance on time.sleep

Use proper retry loop to wait for state to converge, not some arbitrary delay.

fixes #15878

Signed-off-by: Christian Hopps <chopps@labn.net>
11 months agozebra: clean up one comment
anlan_cs [Fri, 28 Apr 2023 23:49:35 +0000 (07:49 +0800)]
zebra: clean up one comment

With the commit `605df8d4`, all real things are moved into dplane.
So the operations mentioned in this comment have nothing to do with
this function `netlink_link_change()`.

Just remove that confusing and useless comment.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
11 months agoMerge pull request #15891 from mjstapp/retry_pathd_sync_conn
Donatas Abraitis [Thu, 2 May 2024 08:18:10 +0000 (11:18 +0300)]
Merge pull request #15891 from mjstapp/retry_pathd_sync_conn

pathd: retry label-manager connection asynchronously

11 months agoMerge pull request #15890 from httpstorm/frr-macOS-section.2024-04-30
David Lamparter [Wed, 1 May 2024 14:55:54 +0000 (16:55 +0200)]
Merge pull request #15890 from httpstorm/frr-macOS-section.2024-04-30

11 months agoMerge pull request #15892 from donaldsharp/parse_attr_problems
Mark Stapp [Wed, 1 May 2024 13:43:11 +0000 (09:43 -0400)]
Merge pull request #15892 from donaldsharp/parse_attr_problems

zebra: Ensure proper decoding of netlink message

11 months agotests: Check if iBGP session can drop invalid AIGP attribute
Donatas Abraitis [Wed, 1 May 2024 13:33:52 +0000 (16:33 +0300)]
tests: Check if iBGP session can drop invalid AIGP attribute

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
11 months agobgpd: Ignore validating the attribute flags if path-attribute is configured
Donatas Abraitis [Wed, 1 May 2024 13:01:38 +0000 (16:01 +0300)]
bgpd: Ignore validating the attribute flags if path-attribute is configured

E.g. Cisco sends AIGP attribute as transitive, but it's wrong. Hence, the session
is teared down, because of this bgp_attr_flag_invalid() test.

Relax this check if we have `neighbor X path-attribute <discard|treat-as-withdraw>`
configured.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
11 months agoMerge pull request #15673 from pguibert6WIND/isis_srv6_usid
Donatas Abraitis [Wed, 1 May 2024 05:26:28 +0000 (08:26 +0300)]
Merge pull request #15673 from pguibert6WIND/isis_srv6_usid

lib: fix srv6 locator flags propagated to isis

11 months agoMerge pull request #15874 from pguibert6WIND/bgp_get_sockname_coverity_1585206
Donatas Abraitis [Wed, 1 May 2024 05:24:31 +0000 (08:24 +0300)]
Merge pull request #15874 from pguibert6WIND/bgp_get_sockname_coverity_1585206

bgpd: fix covery ID 1585206

11 months agozebra: Ensure proper decoding of netlink message
Donald Sharp [Tue, 30 Apr 2024 14:53:48 +0000 (10:53 -0400)]
zebra: Ensure proper decoding of netlink message

As part of the kernel netlink functionality, it is
possible that a bit of nested attributes can be
passed up.  This attribute has a type value which
is stored in the lower 8 bits and in the upper 8
bits are a couple control flags that can be used.
FRR can parse this data and then just throw away
the value unless we mask off the upper 8 bits.
Let's ensure that it can be properly parsed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
11 months agopathd: clean up a log message
Mark Stapp [Tue, 30 Apr 2024 18:34:58 +0000 (14:34 -0400)]
pathd: clean up a log message

Clean up a typo in a log message.

Signed-off-by: Mark Stapp <mjs@cisco.com>
11 months agopathd: retry synchronous label-manager zapi connection
Mark Stapp [Tue, 30 Apr 2024 18:33:13 +0000 (14:33 -0400)]
pathd: retry synchronous label-manager zapi connection

Be prepared to retry setting up pathd's synchronous zapi session
that's used for label-manager.

Signed-off-by: Mark Stapp <mjs@cisco.com>
11 months agolib: fix error on MacOS
Ruben Kerkhof [Wed, 18 Mar 2020 14:40:39 +0000 (15:40 +0100)]
lib: fix error on MacOS

Sections use a different syntax for Mach-O executables.

Fixes:

lib/bfd.c:35:1: error: argument to 'section' attribute is not valid for this target: mach-o section specifier requires a segment and section separated by a
      comma
DEFINE_MTYPE_STATIC(LIB, BFD_INFO, "BFD info")
^
./lib/memory.h:140:2: note: expanded from macro 'DEFINE_MTYPE_STATIC'
        DEFINE_MTYPE_ATTR(group, name, static, desc)                           \
        ^
./lib/memory.h:110:26: note: expanded from macro 'DEFINE_MTYPE_ATTR'
                __attribute__((section(".data.mtypes"))) = { {                 \
                                       ^
1 error generated.

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
11 months agoMerge pull request #15791 from zhou-run/202404182042
Olivier Dugeon [Tue, 30 Apr 2024 14:33:48 +0000 (16:33 +0200)]
Merge pull request #15791 from zhou-run/202404182042

isisd: When the ISIS instance does not exist, the default metric will not be wide.

11 months agoMerge pull request #15653 from pguibert6WIND/link_state_srv6_capas
Olivier Dugeon [Tue, 30 Apr 2024 13:39:11 +0000 (15:39 +0200)]
Merge pull request #15653 from pguibert6WIND/link_state_srv6_capas

Link state srv6 capas