]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
20 months agobgpd: Do not explicitly print MAXTTL value for ebgp-multihop vty output
Donatas Abraitis [Sun, 20 Aug 2023 21:01:42 +0000 (00:01 +0300)]
bgpd: Do not explicitly print MAXTTL value for ebgp-multihop vty output

1. Create /etc/frr/frr.conf
```
frr version 7.5
frr defaults traditional
hostname centos8.localdomain
no ip forwarding
no ipv6 forwarding
service integrated-vtysh-config
line vty
router bgp 4250001000
  neighbor 192.168.122.207 remote-as 65512
  neighbor 192.168.122.207 ebgp-multihop
```

2. Start FRR
`# systemctl start frr
`
3. Show running configuration. Note that FRR explicitly set and shows the default TTL (225)

```
Building configuration...

Current configuration:
!
frr version 7.5
frr defaults traditional
hostname centos8.localdomain
no ip forwarding
no ipv6 forwarding
service integrated-vtysh-config
!
router bgp 4250001000
 neighbor 192.168.122.207 remote-as 65512
 neighbor 192.168.122.207 ebgp-multihop 255
!
line vty
!
end
```
4. Copy initial frr.conf to frr.conf.new (no changes)
`# cp /etc/frr/frr.conf /root/frr.conf.new
`
5. Run frr-reload.sh:

```
$ /usr/lib/frr/frr-reload.py --test  /root/frr.conf.new
2023-08-20 20:15:48,050  INFO: Called via "Namespace(bindir='/usr/bin', confdir='/etc/frr', daemon='', debug=False, filename='/root/frr.conf.new', input=None, log_level='info', overwrite=False, pathspace=None, reload=False, rundir='/var/run/frr', stdout=False, test=True, vty_socket=None)"
2023-08-20 20:15:48,050  INFO: Loading Config object from file /root/frr.conf.new
2023-08-20 20:15:48,124  INFO: Loading Config object from vtysh show running

Lines To Delete
===============
router bgp 4250001000
 no neighbor 192.168.122.207 ebgp-multihop 255

Lines To Add
============
router bgp 4250001000
 neighbor 192.168.122.207 ebgp-multihop
```

Closes https://github.com/FRRouting/frr/issues/14242

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
20 months agoMerge pull request #14226 from Keelan10/fix-pbrd-leak
Donatas Abraitis [Sun, 20 Aug 2023 19:32:21 +0000 (22:32 +0300)]
Merge pull request #14226 from Keelan10/fix-pbrd-leak

pbrd: Correct Handling of Sequence Deletion

20 months agopbrd: Correct Handling of Sequence Deletion
Keelan10 [Thu, 17 Aug 2023 19:54:33 +0000 (23:54 +0400)]
pbrd: Correct Handling of Sequence Deletion

This commit ensures that sequence data
and associated structures are correctly deleted to prevent memory leaks

The ASan leak log for reference:
```
Direct leak of 432 byte(s) in 1 object(s) allocated from:
    #0 0x7f911ebaba37 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
    #1 0x7f911e749a4e in qcalloc ../lib/memory.c:105
    #2 0x564fd444b2d3 in pbrms_get ../pbrd/pbr_map.c:527
    #3 0x564fd443a82d in pbr_map ../pbrd/pbr_vty.c:90
    #4 0x7f911e691d61 in cmd_execute_command_real ../lib/command.c:993
    #5 0x7f911e6920ee in cmd_execute_command ../lib/command.c:1052
    #6 0x7f911e692dc0 in cmd_execute ../lib/command.c:1218
    #7 0x7f911e843197 in vty_command ../lib/vty.c:591
    #8 0x7f911e84807c in vty_execute ../lib/vty.c:1354
    #9 0x7f911e84e47a in vtysh_read ../lib/vty.c:2362
    #10 0x7f911e8332f4 in event_call ../lib/event.c:1979
    #11 0x7f911e71d828 in frr_run ../lib/libfrr.c:1213
    #12 0x564fd4425795 in main ../pbrd/pbr_main.c:168
    #13 0x7f911e2e1d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

```

Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
20 months agoMerge pull request #14216 from LabNConsulting/ziemba-coverity-pbr-230816
Donald Sharp [Sat, 19 Aug 2023 20:17:14 +0000 (16:17 -0400)]
Merge pull request #14216 from LabNConsulting/ziemba-coverity-pbr-230816

pbrd: address coverity issues reported 230815

20 months agoMerge pull request #14238 from Keelan10/ospf-leak-fix
Donald Sharp [Sat, 19 Aug 2023 20:12:08 +0000 (16:12 -0400)]
Merge pull request #14238 from Keelan10/ospf-leak-fix

ospfd: Delete `q_space->vertex_list` on No Backup Path

20 months agoMerge pull request #14236 from Keelan10/bgpd-memleak
Donald Sharp [Sat, 19 Aug 2023 20:11:30 +0000 (16:11 -0400)]
Merge pull request #14236 from Keelan10/bgpd-memleak

bgpd: Free memory in set_aspath_exclude_access_list

20 months agoospfd: Delete `q_space->vertex_list` on No Backup Path
Keelan10 [Sat, 19 Aug 2023 14:38:14 +0000 (18:38 +0400)]
ospfd: Delete `q_space->vertex_list` on No Backup Path

In scenarios where no backup paths are available, ensure proper
memory management by deleting `q_space->vertex_list`. This prevents
memory leaks.

The ASan leak log for reference:

```
Direct leak of 80 byte(s) in 2 object(s) allocated from:
    #0 0x7fcf8c70aa37 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
    #1 0x7fcf8c2a8a45 in qcalloc ../lib/memory.c:105
    #2 0x7fcf8c27d0cc in list_new ../lib/linklist.c:49
    #3 0x55d6e8385e35 in ospf_spf_init ../ospfd/ospf_spf.c:540
    #4 0x55d6e838c30d in ospf_spf_calculate ../ospfd/ospf_spf.c:1736
    #5 0x55d6e83933cf in ospf_ti_lfa_generate_q_spaces ../ospfd/ospf_ti_lfa.c:673
    #6 0x55d6e8394214 in ospf_ti_lfa_generate_p_space ../ospfd/ospf_ti_lfa.c:812
    #7 0x55d6e8394c63 in ospf_ti_lfa_generate_p_spaces ../ospfd/ospf_ti_lfa.c:923
    #8 0x55d6e8396390 in ospf_ti_lfa_compute ../ospfd/ospf_ti_lfa.c:1101
    #9 0x55d6e838ca48 in ospf_spf_calculate_area ../ospfd/ospf_spf.c:1811
    #10 0x55d6e838cd73 in ospf_spf_calculate_areas ../ospfd/ospf_spf.c:1840
    #11 0x55d6e838cfb0 in ospf_spf_calculate_schedule_worker ../ospfd/ospf_spf.c:1871
    #12 0x7fcf8c3922e4 in event_call ../lib/event.c:1979
    #13 0x7fcf8c27c828 in frr_run ../lib/libfrr.c:1213
    #14 0x55d6e82eeb6d in main ../ospfd/ospf_main.c:249
    #15 0x7fcf8bd59d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

```

Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
20 months agobgpd: Free memory in set_aspath_exclude_access_list
Keelan10 [Sat, 19 Aug 2023 10:00:17 +0000 (14:00 +0400)]
bgpd: Free memory in set_aspath_exclude_access_list

Properly free the dynamically allocated memory held by `str` after its use.
The change also maintains the return value of `nb_cli_apply_changes` by using `ret` variable.

The ASan leak log for reference:

```
Direct leak of 55 byte(s) in 2 object(s) allocated from:
    #0 0x7f16f285f867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
    #1 0x7f16f23fda11 in qmalloc ../lib/memory.c:100
    #2 0x7f16f23a01a0 in frrstr_join ../lib/frrstr.c:89
    #3 0x7f16f23418c7 in argv_concat ../lib/command.c:183
    #4 0x55aba24731f2 in set_aspath_exclude_access_list_magic ../bgpd/bgp_routemap.c:6327
    #5 0x55aba2455cf4 in set_aspath_exclude_access_list bgpd/bgp_routemap_clippy.c:836
    #6 0x7f16f2345d61 in cmd_execute_command_real ../lib/command.c:993
    #7 0x7f16f23460ee in cmd_execute_command ../lib/command.c:1052
    #8 0x7f16f2346dc0 in cmd_execute ../lib/command.c:1218
    #9 0x7f16f24f7197 in vty_command ../lib/vty.c:591
    #10 0x7f16f24fc07c in vty_execute ../lib/vty.c:1354
    #11 0x7f16f250247a in vtysh_read ../lib/vty.c:2362
    #12 0x7f16f24e72f4 in event_call ../lib/event.c:1979
    #13 0x7f16f23d1828 in frr_run ../lib/libfrr.c:1213
    #14 0x55aba2269e52 in main ../bgpd/bgp_main.c:510
    #15 0x7f16f1dbfd8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
```

Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
20 months agopbrd: address 230815 coverity: pbr_vty.c vrf_name
G. Paul Ziemba [Fri, 18 Aug 2023 18:19:05 +0000 (11:19 -0700)]
pbrd: address 230815 coverity: pbr_vty.c vrf_name

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
20 months agopbrd: address 230815 coverity: pbr_vty.c pbrms
G. Paul Ziemba [Fri, 18 Aug 2023 18:14:25 +0000 (11:14 -0700)]
pbrd: address 230815 coverity: pbr_vty.c pbrms

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
20 months agopbrd: address 230815 coverity: pbr_vty.c pend/strtoul
G. Paul Ziemba [Fri, 18 Aug 2023 18:13:20 +0000 (11:13 -0700)]
pbrd: address 230815 coverity: pbr_vty.c pend/strtoul

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
20 months agopbrd: address 230815 coverity: r.action.flags reordering
G. Paul Ziemba [Fri, 18 Aug 2023 18:11:17 +0000 (11:11 -0700)]
pbrd: address 230815 coverity: r.action.flags reordering

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
20 months agoMerge pull request #14223 from donaldsharp/interface_fies
Mark Stapp [Fri, 18 Aug 2023 15:56:20 +0000 (11:56 -0400)]
Merge pull request #14223 from donaldsharp/interface_fies

zebra: Fix crashes in interface change

20 months agoMerge pull request #14224 from Keelan10/fix-bgpd-leak
Donatas Abraitis [Fri, 18 Aug 2023 07:21:50 +0000 (10:21 +0300)]
Merge pull request #14224 from Keelan10/fix-bgpd-leak

bgpd: Free memory in set_aspath_replace_access_list

20 months agobgpd: Free memory in set_aspath_replace_access_list
Keelan10 [Thu, 17 Aug 2023 16:42:11 +0000 (20:42 +0400)]
bgpd: Free memory in set_aspath_replace_access_list

Properly free the dynamically allocated memory held by `str` after its use.
The change also maintains the return value of `nb_cli_apply_changes` by using 'ret' variable.

The ASan leak log for reference:

```
***********************************************************************************
Address Sanitizer Error detected in bgp_set_aspath_replace.test_bgp_set_aspath_replace/r1.asan.bgpd.11586

=================================================================
==11586==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 92 byte(s) in 3 object(s) allocated from:
    #0 0x7f4e2951db40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x7f4e28f19ea2 in qmalloc lib/memory.c:100
    #2 0x7f4e28edbb08 in frrstr_join lib/frrstr.c:89
    #3 0x7f4e28e9a601 in argv_concat lib/command.c:183
    #4 0x56519adf8413 in set_aspath_replace_access_list_magic bgpd/bgp_routemap.c:6174
    #5 0x56519adf8942 in set_aspath_replace_access_list bgpd/bgp_routemap_clippy.c:683
    #6 0x7f4e28e9d548 in cmd_execute_command_real lib/command.c:993
    #7 0x7f4e28e9da0c in cmd_execute_command lib/command.c:1051
    #8 0x7f4e28e9de8b in cmd_execute lib/command.c:1218
    #9 0x7f4e28fc4f1c in vty_command lib/vty.c:591
    #10 0x7f4e28fc53c7 in vty_execute lib/vty.c:1354
    #11 0x7f4e28fcdc8d in vtysh_read lib/vty.c:2362
    #12 0x7f4e28fb8c8b in event_call lib/event.c:1979
    #13 0x7f4e28efd445 in frr_run lib/libfrr.c:1213
    #14 0x56519ac85d81 in main bgpd/bgp_main.c:510
    #15 0x7f4e27f40c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

SUMMARY: AddressSanitizer: 92 byte(s) leaked in 3 allocation(s).
***********************************************************************************

***********************************************************************************
Address Sanitizer Error detected in bgp_set_aspath_exclude.test_bgp_set_aspath_exclude/r1.asan.bgpd.10385

=================================================================
==10385==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 55 byte(s) in 2 object(s) allocated from:
    #0 0x7f6814fdab40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x7f68149d6ea2 in qmalloc lib/memory.c:100
    #2 0x7f6814998b08 in frrstr_join lib/frrstr.c:89
    #3 0x7f6814957601 in argv_concat lib/command.c:183
    #4 0x5570e05117a1 in set_aspath_exclude_access_list_magic bgpd/bgp_routemap.c:6327
    #5 0x5570e05119da in set_aspath_exclude_access_list bgpd/bgp_routemap_clippy.c:836
    #6 0x7f681495a548 in cmd_execute_command_real lib/command.c:993
    #7 0x7f681495aa0c in cmd_execute_command lib/command.c:1051
    #8 0x7f681495ae8b in cmd_execute lib/command.c:1218
    #9 0x7f6814a81f1c in vty_command lib/vty.c:591
    #10 0x7f6814a823c7 in vty_execute lib/vty.c:1354
    #11 0x7f6814a8ac8d in vtysh_read lib/vty.c:2362
    #12 0x7f6814a75c8b in event_call lib/event.c:1979
    #13 0x7f68149ba445 in frr_run lib/libfrr.c:1213
    #14 0x5570e03a0d81 in main bgpd/bgp_main.c:510
    #15 0x7f68139fdc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

SUMMARY: AddressSanitizer: 55 byte(s) leaked in 2 allocation(s).
***********************************************************************************
```

Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
20 months agoMerge pull request #14218 from Pdoijode/pdoijode/frr-bgp-nexthop-find-fix
Mark Stapp [Thu, 17 Aug 2023 13:56:36 +0000 (09:56 -0400)]
Merge pull request #14218 from Pdoijode/pdoijode/frr-bgp-nexthop-find-fix

bgpd: Set ifindex to find the correct nexthop

20 months agozebra: Fix crashes in interface change
Donald Sharp [Mon, 14 Aug 2023 19:06:30 +0000 (15:06 -0400)]
zebra: Fix crashes in interface change

Upon some internal testing some crashes were found.  This fixes
the several crashes and normalizes the code to be closer in
it's execution pre and post changes to use the data plane.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
20 months agobgpd: Set ifindex to find the correct nexthop
Pooja Jagadeesh Doijode [Wed, 16 Aug 2023 22:27:38 +0000 (15:27 -0700)]
bgpd: Set ifindex to find the correct nexthop

Problem:
    On GR helper, paths learnt from an interface based peer were linked
    to bnc with ifindex=0. During restart of GR peer, BGP (unnumbered)
    session (with GR restarter peer) goes down on GR helper but the routes
    are retained. Later, when BGP receives an interface up event, it
    will process all the paths associated with BNC whose ifindex matches the
    ifindex of the interface for which UP event is received. However, paths
    associated with bnc that has ifindex=0 were not being reinstalled since
    ifindex=0 doesn't match ifindex of any interfaces. This results in
    BGP routes not being reinstalled in zebra and kernel.

Fix:
    For paths learnt from an interface based peer, set the
    ifindex to peer's interface ifindex so that correct
    peer based nexthop can be found and linked to the path.

Signed-off-by: Donald Sharp sharpd@nvidia.com
Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
20 months agoMerge pull request #14181 from opensourcerouting/fix/bgpd_labeled_unicast_set_explici...
Donald Sharp [Wed, 16 Aug 2023 13:25:49 +0000 (09:25 -0400)]
Merge pull request #14181 from opensourcerouting/fix/bgpd_labeled_unicast_set_explicit_null

bgpd: Assign explicit-null for default-originate according to the AFI

20 months agoMerge pull request #14204 from opensourcerouting/fix/clear_bgp
Donald Sharp [Wed, 16 Aug 2023 13:25:23 +0000 (09:25 -0400)]
Merge pull request #14204 from opensourcerouting/fix/clear_bgp

lib: Lower precedence for ASNUM_TKN when using together with IPV4/IPV6_TKN

20 months agoMerge pull request #14213 from opensourcerouting/fix/cli_descriptions_bgp_confederation
Donald Sharp [Wed, 16 Aug 2023 13:24:35 +0000 (09:24 -0400)]
Merge pull request #14213 from opensourcerouting/fix/cli_descriptions_bgp_confederation

bgpd: Fix CLI descriptions for `bgp confederation identifier`

20 months agoMerge pull request #13623 from Keelan10/zebra-leak-fix
Donatas Abraitis [Wed, 16 Aug 2023 08:35:24 +0000 (11:35 +0300)]
Merge pull request #13623 from Keelan10/zebra-leak-fix

zebra: Delete the 'mbr_zifs' list in the if_zebra_delete_hook function

20 months agoMerge pull request #14207 from routingrocks/cover_fixes
Donatas Abraitis [Wed, 16 Aug 2023 06:00:06 +0000 (09:00 +0300)]
Merge pull request #14207 from routingrocks/cover_fixes

bgpd: fix coverity issue in bgpd

20 months agobgpd: Fix CLI descriptions for `bgp confederation identifier`
Donatas Abraitis [Wed, 16 Aug 2023 05:37:23 +0000 (08:37 +0300)]
bgpd: Fix CLI descriptions for `bgp confederation identifier`

Before the patch:

```
donatas-laptop(config-router)# bgp confederation
  identifier  AS number in plain  <1-4294967295> or dotted <0-65535>.<0-65535> format
  peers       Peer ASs in BGP confederation
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
20 months agoMerge pull request #14184 from opensourcerouting/fix/cpu-wall-warning_vtysh_fixes_for...
Donald Sharp [Tue, 15 Aug 2023 20:01:07 +0000 (16:01 -0400)]
Merge pull request #14184 from opensourcerouting/fix/cpu-wall-warning_vtysh_fixes_for_no_form

lib: Allow unsetting walltime-warning and cpu-warning

20 months agobgpd: fix coverity issue in bgpd
Rajesh Varatharaj [Tue, 15 Aug 2023 18:13:20 +0000 (11:13 -0700)]
bgpd: fix coverity issue in bgpd

Should address this issue:
** CID 1566843:  Uninitialized variables  (UNINIT)
/bgpd/bgp_route.c: 6754 in bgp_static_set()
6748                            bgp_static->backdoor = backdoor;
6749                            bgp_static->valid = 0;
6750                            bgp_static->igpmetric = 0;
6751                            bgp_static->igpnexthop.s_addr = INADDR_ANY;
6752                            bgp_static->label_index = label_index;
6753                            bgp_static->label = label;
>>>     CID 1566843:  Uninitialized variables  (UNINIT)
>>>     Using uninitialized value prd.
6754                            bgp_static->prd = prd;
6755
6756                            if (rmap) {
6757                                    XFREE(MTYPE_ROUTE_MAP_NAME,
6758                                          bgp_static->rmap.name);
6759                                    route_map_counter_decrement(

Testing Done:
 build

Ticket: #NA
Signed-off-by: Rajesh Varatharaj <rvaratharaj@nvidia.com>
20 months agoMerge pull request #14193 from donaldsharp/pim_vxlan_weirdness
mobash-rasool [Tue, 15 Aug 2023 16:56:21 +0000 (22:26 +0530)]
Merge pull request #14193 from donaldsharp/pim_vxlan_weirdness

Do not look into pim's eyes, pim gets mad

20 months agoMerge pull request #14016 from mjstapp/event_exec_ptr
Donald Sharp [Tue, 15 Aug 2023 15:52:49 +0000 (11:52 -0400)]
Merge pull request #14016 from mjstapp/event_exec_ptr

* : include event ptr in event_execute api

20 months agoMerge pull request #14175 from samanvithab/bgpd_update_err_fix
Russ White [Tue, 15 Aug 2023 15:35:37 +0000 (11:35 -0400)]
Merge pull request #14175 from samanvithab/bgpd_update_err_fix

bgpd: Few fixes for Update message error handling of malformed attribute

20 months agoMerge pull request #14198 from opensourcerouting/feature/refactor_bgp_static_set
Donald Sharp [Tue, 15 Aug 2023 13:36:18 +0000 (09:36 -0400)]
Merge pull request #14198 from opensourcerouting/feature/refactor_bgp_static_set

bgpd: Refactor bgp_static_set/bgp_static_set_safi

20 months agolib: Lower precedence for ASNUM_TKN when using together with IPV4/IPV6_TKN
Donatas Abraitis [Tue, 15 Aug 2023 09:13:54 +0000 (12:13 +0300)]
lib: Lower precedence for ASNUM_TKN when using together with IPV4/IPV6_TKN

When using together with IPV4/IPV6_TKN, this breaks an existing command like:

```
donatas-pc# clear bgp ipv6 unicast 2a02::1
% Ambiguous command: clear bgp ipv6 unicast 2a02::1
donatas-pc#
```

With this fix:

```
donatas-pc# clear bgp ipv6 unicast 2a02::1
% BGP: Unknown neighbor - "2a02::1"
donatas-pc# clear bgp ipv6 unicast 2.2
% BGP: No IPv6 Unicast peer is configured with AS 2.2
donatas-pc# clear bgp ipv6 unicast 123
% BGP: No IPv6 Unicast peer is configured with AS 123
donatas-pc# clear bgp ipv4 unicast 127.0.0.1
donatas-pc#
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
20 months agopimd: Add whether or not the rpf succeeded or not to the debug
Donald Sharp [Sat, 12 Aug 2023 15:40:30 +0000 (11:40 -0400)]
pimd: Add whether or not the rpf succeeded or not to the debug

Hard to know what is going on if the debug doesn't tell us.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
20 months agopimd: Intentionally rescan oil when RPF fails on upstream creation
Donald Sharp [Sat, 12 Aug 2023 15:29:37 +0000 (11:29 -0400)]
pimd: Intentionally rescan oil when RPF fails on upstream creation

When pim is creating an upstream for a S,G that it has received
*but* it has not received a route to the S, the oil is not
scanned to see if it should inherit anything from the *,G
that may be present when it cannot find the correct iif to
use.  When the nexthop tracking actually
resolves the route, the oil is never rescanned and the
S,G stream will be missing a correct oil list leading
to absolute mayhem in the network.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
20 months agobgpd: Refactor bgp_static_set/bgp_static_set_safi
Donatas Abraitis [Thu, 10 Aug 2023 08:37:40 +0000 (11:37 +0300)]
bgpd: Refactor bgp_static_set/bgp_static_set_safi

Those two functions are very similar, let's get a single one.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
20 months agoMerge pull request #14189 from donaldsharp/do_not_use_system_calls
Jafar Al-Gharaibeh [Sun, 13 Aug 2023 21:02:17 +0000 (16:02 -0500)]
Merge pull request #14189 from donaldsharp/do_not_use_system_calls

doc: Prohibit usage of `system()` calls in FRR

20 months agoMerge pull request #14183 from donaldsharp/zebra_routemap_cleanup
Donatas Abraitis [Sun, 13 Aug 2023 16:57:30 +0000 (19:57 +0300)]
Merge pull request #14183 from donaldsharp/zebra_routemap_cleanup

Zebra routemap cleanup

20 months agoMerge pull request #14096 from gongjianLhr/dup_fix
Donatas Abraitis [Sun, 13 Aug 2023 13:44:49 +0000 (16:44 +0300)]
Merge pull request #14096 from gongjianLhr/dup_fix

zebra: remove duplicated nexthops when sending fpm msg

20 months agoMerge pull request #14126 from LabNConsulting/ziemba-pbr-actions-mangling
Donatas Abraitis [Sun, 13 Aug 2023 13:39:07 +0000 (16:39 +0300)]
Merge pull request #14126 from LabNConsulting/ziemba-pbr-actions-mangling

pbrd: (3/3) add packet mangling actions (src/dst ip-addr/port, dscp, ecn)

20 months agopimd: Allow more immediate null registers to be sent in the vxlan code
Donald Sharp [Sat, 12 Aug 2023 04:14:00 +0000 (00:14 -0400)]
pimd: Allow more immediate null registers to be sent in the vxlan code

When a pim vxlan S,G is created, the code attempts to send out a NULL
register.  This is used to build the S,G tree from the RP to the
FHR.  Upon initial startup it is not unusual for the pim vxlan state
be fully ready to go but the RP is still not reachable.  Let's add
a bit of a pump prime that allows the vxlan code to re-attempt to
send the null register for vxlan S,G's that the RP's outgoing
interface changed from unknown to an actual interface.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
20 months agobgpd: Fix update message error handling for multiple same attributes
Samanvitha B Bhargav [Fri, 11 Aug 2023 10:32:16 +0000 (03:32 -0700)]
bgpd: Fix update message error handling for multiple same attributes

As per RFC7606 section 3g,
   g.  If the MP_REACH_NLRI attribute or the MP_UNREACH_NLRI [RFC4760]
       attribute appears more than once in the UPDATE message, then a
       NOTIFICATION message MUST be sent with the Error Subcode
       "Malformed Attribute List".  If any other attribute (whether
       recognized or unrecognized) appears more than once in an UPDATE
       message, then all the occurrences of the attribute other than the
       first one SHALL be discarded and the UPDATE message will continue
       to be processed.
However, notification is sent out currently for all the cases.
Fix:
For cases other than MP_REACH_NLRI & MP_UNREACH_NLRI, handling has been updated
to discard the occurrences other than the first one and proceed with further parsing.
Again, the handling is relaxed only for the EBGP case.
Also, since in case of error, the attribute is discarded &
stream pointer is being adjusted accordingly based on length,
the total attribute length sanity check case has been moved up in the function
to be checked before this case.

Signed-off-by: Samanvitha B Bhargav <bsamanvitha@vmware.com>
20 months agobgpd: Fix update message error handling for total attribute length
Samanvitha B Bhargav [Tue, 8 Aug 2023 12:09:16 +0000 (05:09 -0700)]
bgpd: Fix update message error handling for total attribute length

As per RFC7606 section 4,
when the total attribute length value is in conflict with the
enclosed attribute length, treat-as-withdraw approach must be followed.
However, notification is being sent out for this case currently,
that leads to session reset.
Fix:
The handling has been updated to conform to treat-as-withdraw
approach only for EBGP case. For IBGP, since we are not following
treat-as-withdraw approach for any of the error handling cases,
the existing behavior is retained for the IBGP.

Signed-off-by: Samanvitha B Bhargav <bsamanvitha@vmware.com>
20 months agozebra: Delete the 'mbr_zifs' list in the if_zebra_delete_hook function
Keelan10 [Mon, 29 May 2023 05:50:17 +0000 (09:50 +0400)]
zebra: Delete the 'mbr_zifs' list in the if_zebra_delete_hook function

This commit addresses a memory leak issue detected by ASan associated with the member lists (mbr_zifs) of bond interfaces.
Previously, the member lists were not properly deleted during interface deletion, leading to memory leaks.
A call to list_delete() is made when interface is deleted.

The ASan leak log for reference:

```
./bgp_evpn_mh.test_evpn_mh/torm12.zebra.asan.662047:Direct leak of 80 byte(s) in 2 object(s) allocated from:
./bgp_evpn_mh.test_evpn_mh/torm12.zebra.asan.662047-    #0 0x7fe7a5b9d037 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
./bgp_evpn_mh.test_evpn_mh/torm12.zebra.asan.662047-    FRRouting#1 0x7fe7a57431ee in qcalloc lib/memory.c:105
./bgp_evpn_mh.test_evpn_mh/torm12.zebra.asan.662047-    FRRouting#2 0x7fe7a571833c in list_new lib/linklist.c:49
./bgp_evpn_mh.test_evpn_mh/torm12.zebra.asan.662047-    FRRouting#3 0x55c1b87a7525 in zebra_l2if_update_bond zebra/zebra_l2.c:223
./bgp_evpn_mh.test_evpn_mh/torm12.zebra.asan.662047-    FRRouting#4 0x55c1b86e044d in netlink_interface zebra/if_netlink.c:1203
./bgp_evpn_mh.test_evpn_mh/torm12.zebra.asan.662047-    FRRouting#5 0x55c1b870fbcf in netlink_parse_info zebra/kernel_netlink.c:1183
./bgp_evpn_mh.test_evpn_mh/torm12.zebra.asan.662047-    FRRouting#6 0x55c1b86e0cc1 in interface_lookup_netlink zebra/if_netlink.c:1273
./bgp_evpn_mh.test_evpn_mh/torm12.zebra.asan.662047-    FRRouting#7 0x55c1b86e8b27 in interface_list zebra/if_netlink.c:2419
./bgp_evpn_mh.test_evpn_mh/torm12.zebra.asan.662047-    FRRouting#8 0x55c1b8817a77 in zebra_ns_enable zebra/zebra_ns.c:113
./bgp_evpn_mh.test_evpn_mh/torm12.zebra.asan.662047-    FRRouting#9 0x55c1b8817e76 in zebra_ns_init zebra/zebra_ns.c:205
./bgp_evpn_mh.test_evpn_mh/torm12.zebra.asan.662047-    FRRouting#10 0x55c1b8717b38 in main zebra/main.c:399
./bgp_evpn_mh.test_evpn_mh/torm12.zebra.asan.662047-    FRRouting#11 0x7fe7a5231d09 in __libc_start_main ../csu/libc-start.c:308
./bgp_evpn_mh.test_evpn_mh/torm12.zebra.asan.662047-
./bgp_evpn_mh.test_evpn_mh/torm12.zebra.asan.662047:Indirect leak of 48 byte(s) in 2 object(s) allocated from:
./bgp_evpn_mh.test_evpn_mh/torm12.zebra.asan.662047-    #0 0x7fe7a5b9d037 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
./bgp_evpn_mh.test_evpn_mh/torm12.zebra.asan.662047-    FRRouting#1 0x7fe7a57431ee in qcalloc lib/memory.c:105
./bgp_evpn_mh.test_evpn_mh/torm12.zebra.asan.662047-    FRRouting#2 0x7fe7a571843d in listnode_new lib/linklist.c:71
./bgp_evpn_mh.test_evpn_mh/torm12.zebra.asan.662047-    FRRouting#3 0x7fe7a5718780 in listnode_add lib/linklist.c:92
./bgp_evpn_mh.test_evpn_mh/torm12.zebra.asan.662047-    FRRouting#4 0x55c1b87a6fdf in zebra_l2_map_slave_to_bond zebra/zebra_l2.c:168
./bgp_evpn_mh.test_evpn_mh/torm12.zebra.asan.662047-    FRRouting#5 0x55c1b86f177d in zebra_if_update_all_links zebra/interface.c:1150
./bgp_evpn_mh.test_evpn_mh/torm12.zebra.asan.662047-    FRRouting#6 0x55c1b86e0d51 in interface_lookup_netlink zebra/if_netlink.c:1303
./bgp_evpn_mh.test_evpn_mh/torm12.zebra.asan.662047-    FRRouting#7 0x55c1b86e8b27 in interface_list zebra/if_netlink.c:2419
./bgp_evpn_mh.test_evpn_mh/torm12.zebra.asan.662047-    FRRouting#8 0x55c1b8817a77 in zebra_ns_enable zebra/zebra_ns.c:113
./bgp_evpn_mh.test_evpn_mh/torm12.zebra.asan.662047-    FRRouting#9 0x55c1b8817e76 in zebra_ns_init zebra/zebra_ns.c:205
./bgp_evpn_mh.test_evpn_mh/torm12.zebra.asan.662047-    FRRouting#10 0x55c1b8717b38 in main zebra/main.c:399
./bgp_evpn_mh.test_evpn_mh/torm12.zebra.asan.662047-    FRRouting#11 0x7fe7a5231d09 in __libc_start_main ../csu/libc-start.c:308
./bgp_evpn_mh.test_evpn_mh/torm12.zebra.asan.662047-
./bgp_evpn_mh.test_evpn_mh/torm12.zebra.asan.662047-SUMMARY: AddressSanitizer: 128 byte(s) leaked in 4 allocation(s).
--
./bgp_evpn_mh.test_evpn_mh/torm21.zebra.asan.663918:Direct leak of 80 byte(s) in 2 object(s) allocated from:
./bgp_evpn_mh.test_evpn_mh/torm21.zebra.asan.663918-    #0 0x7fd8c357f037 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
./bgp_evpn_mh.test_evpn_mh/torm21.zebra.asan.663918-    FRRouting#1 0x7fd8c31251ee in qcalloc lib/memory.c:105
./bgp_evpn_mh.test_evpn_mh/torm21.zebra.asan.663918-    FRRouting#2 0x7fd8c30fa33c in list_new lib/linklist.c:49
./bgp_evpn_mh.test_evpn_mh/torm21.zebra.asan.663918-    FRRouting#3 0x56101df23525 in zebra_l2if_update_bond zebra/zebra_l2.c:223
./bgp_evpn_mh.test_evpn_mh/torm21.zebra.asan.663918-    FRRouting#4 0x56101de5c44d in netlink_interface zebra/if_netlink.c:1203
./bgp_evpn_mh.test_evpn_mh/torm21.zebra.asan.663918-    FRRouting#5 0x56101de8bbcf in netlink_parse_info zebra/kernel_netlink.c:1183
./bgp_evpn_mh.test_evpn_mh/torm21.zebra.asan.663918-    FRRouting#6 0x56101de5ccc1 in interface_lookup_netlink zebra/if_netlink.c:1273
./bgp_evpn_mh.test_evpn_mh/torm21.zebra.asan.663918-    FRRouting#7 0x56101de64b27 in interface_list zebra/if_netlink.c:2419
./bgp_evpn_mh.test_evpn_mh/torm21.zebra.asan.663918-    FRRouting#8 0x56101df93a77 in zebra_ns_enable zebra/zebra_ns.c:113
./bgp_evpn_mh.test_evpn_mh/torm21.zebra.asan.663918-    FRRouting#9 0x56101df93e76 in zebra_ns_init zebra/zebra_ns.c:205
./bgp_evpn_mh.test_evpn_mh/torm21.zebra.asan.663918-    FRRouting#10 0x56101de93b38 in main zebra/main.c:399
./bgp_evpn_mh.test_evpn_mh/torm21.zebra.asan.663918-    FRRouting#11 0x7fd8c2c13d09 in __libc_start_main ../csu/libc-start.c:308
./bgp_evpn_mh.test_evpn_mh/torm21.zebra.asan.663918-
./bgp_evpn_mh.test_evpn_mh/torm21.zebra.asan.663918:Indirect leak of 48 byte(s) in 2 object(s) allocated from:
./bgp_evpn_mh.test_evpn_mh/torm21.zebra.asan.663918-    #0 0x7fd8c357f037 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
./bgp_evpn_mh.test_evpn_mh/torm21.zebra.asan.663918-    FRRouting#1 0x7fd8c31251ee in qcalloc lib/memory.c:105
./bgp_evpn_mh.test_evpn_mh/torm21.zebra.asan.663918-    FRRouting#2 0x7fd8c30fa43d in listnode_new lib/linklist.c:71
./bgp_evpn_mh.test_evpn_mh/torm21.zebra.asan.663918-    FRRouting#3 0x7fd8c30fa780 in listnode_add lib/linklist.c:92
./bgp_evpn_mh.test_evpn_mh/torm21.zebra.asan.663918-    FRRouting#4 0x56101df22fdf in zebra_l2_map_slave_to_bond zebra/zebra_l2.c:168
./bgp_evpn_mh.test_evpn_mh/torm21.zebra.asan.663918-    FRRouting#5 0x56101de6d77d in zebra_if_update_all_links zebra/interface.c:1150
./bgp_evpn_mh.test_evpn_mh/torm21.zebra.asan.663918-    FRRouting#6 0x56101de5cd51 in interface_lookup_netlink zebra/if_netlink.c:1303
./bgp_evpn_mh.test_evpn_mh/torm21.zebra.asan.663918-    FRRouting#7 0x56101de64b27 in interface_list zebra/if_netlink.c:2419
./bgp_evpn_mh.test_evpn_mh/torm21.zebra.asan.663918-    FRRouting#8 0x56101df93a77 in zebra_ns_enable zebra/zebra_ns.c:113
./bgp_evpn_mh.test_evpn_mh/torm21.zebra.asan.663918-    FRRouting#9 0x56101df93e76 in zebra_ns_init zebra/zebra_ns.c:205
./bgp_evpn_mh.test_evpn_mh/torm21.zebra.asan.663918-    FRRouting#10 0x56101de93b38 in main zebra/main.c:399
./bgp_evpn_mh.test_evpn_mh/torm21.zebra.asan.663918-    FRRouting#11 0x7fd8c2c13d09 in __libc_start_main ../csu/libc-start.c:308
./bgp_evpn_mh.test_evpn_mh/torm21.zebra.asan.663918-
./bgp_evpn_mh.test_evpn_mh/torm21.zebra.asan.663918-SUMMARY: AddressSanitizer: 128 byte(s) leaked in 4 allocation(s).
--
./bgp_evpn_mh.test_evpn_mh/torm11.zebra.asan.660815:Direct leak of 80 byte(s) in 2 object(s) allocated from:
./bgp_evpn_mh.test_evpn_mh/torm11.zebra.asan.660815-    #0 0x7ff74228b037 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
./bgp_evpn_mh.test_evpn_mh/torm11.zebra.asan.660815-    FRRouting#1 0x7ff741e311ee in qcalloc lib/memory.c:105
./bgp_evpn_mh.test_evpn_mh/torm11.zebra.asan.660815-    FRRouting#2 0x7ff741e0633c in list_new lib/linklist.c:49
./bgp_evpn_mh.test_evpn_mh/torm11.zebra.asan.660815-    FRRouting#3 0x56535dceb525 in zebra_l2if_update_bond zebra/zebra_l2.c:223
./bgp_evpn_mh.test_evpn_mh/torm11.zebra.asan.660815-    FRRouting#4 0x56535dc2444d in netlink_interface zebra/if_netlink.c:1203
./bgp_evpn_mh.test_evpn_mh/torm11.zebra.asan.660815-    FRRouting#5 0x56535dc53bcf in netlink_parse_info zebra/kernel_netlink.c:1183
./bgp_evpn_mh.test_evpn_mh/torm11.zebra.asan.660815-    FRRouting#6 0x56535dc24cc1 in interface_lookup_netlink zebra/if_netlink.c:1273
./bgp_evpn_mh.test_evpn_mh/torm11.zebra.asan.660815-    FRRouting#7 0x56535dc2cb27 in interface_list zebra/if_netlink.c:2419
./bgp_evpn_mh.test_evpn_mh/torm11.zebra.asan.660815-    FRRouting#8 0x56535dd5ba77 in zebra_ns_enable zebra/zebra_ns.c:113
./bgp_evpn_mh.test_evpn_mh/torm11.zebra.asan.660815-    FRRouting#9 0x56535dd5be76 in zebra_ns_init zebra/zebra_ns.c:205
./bgp_evpn_mh.test_evpn_mh/torm11.zebra.asan.660815-    FRRouting#10 0x56535dc5bb38 in main zebra/main.c:399
./bgp_evpn_mh.test_evpn_mh/torm11.zebra.asan.660815-    FRRouting#11 0x7ff74191fd09 in __libc_start_main ../csu/libc-start.c:308
./bgp_evpn_mh.test_evpn_mh/torm11.zebra.asan.660815-
./bgp_evpn_mh.test_evpn_mh/torm11.zebra.asan.660815:Indirect leak of 48 byte(s) in 2 object(s) allocated from:
./bgp_evpn_mh.test_evpn_mh/torm11.zebra.asan.660815-    #0 0x7ff74228b037 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
./bgp_evpn_mh.test_evpn_mh/torm11.zebra.asan.660815-    FRRouting#1 0x7ff741e311ee in qcalloc lib/memory.c:105
./bgp_evpn_mh.test_evpn_mh/torm11.zebra.asan.660815-    FRRouting#2 0x7ff741e0643d in listnode_new lib/linklist.c:71
./bgp_evpn_mh.test_evpn_mh/torm11.zebra.asan.660815-    FRRouting#3 0x7ff741e06780 in listnode_add lib/linklist.c:92
./bgp_evpn_mh.test_evpn_mh/torm11.zebra.asan.660815-    FRRouting#4 0x56535dceafdf in zebra_l2_map_slave_to_bond zebra/zebra_l2.c:168
./bgp_evpn_mh.test_evpn_mh/torm11.zebra.asan.660815-    FRRouting#5 0x56535dc3577d in zebra_if_update_all_links zebra/interface.c:1150
./bgp_evpn_mh.test_evpn_mh/torm11.zebra.asan.660815-    FRRouting#6 0x56535dc24d51 in interface_lookup_netlink zebra/if_netlink.c:1303
./bgp_evpn_mh.test_evpn_mh/torm11.zebra.asan.660815-    FRRouting#7 0x56535dc2cb27 in interface_list zebra/if_netlink.c:2419
./bgp_evpn_mh.test_evpn_mh/torm11.zebra.asan.660815-    FRRouting#8 0x56535dd5ba77 in zebra_ns_enable zebra/zebra_ns.c:113
./bgp_evpn_mh.test_evpn_mh/torm11.zebra.asan.660815-    FRRouting#9 0x56535dd5be76 in zebra_ns_init zebra/zebra_ns.c:205
./bgp_evpn_mh.test_evpn_mh/torm11.zebra.asan.660815-    FRRouting#10 0x56535dc5bb38 in main zebra/main.c:399
./bgp_evpn_mh.test_evpn_mh/torm11.zebra.asan.660815-    FRRouting#11 0x7ff74191fd09 in __libc_start_main ../csu/libc-start.c:308
./bgp_evpn_mh.test_evpn_mh/torm11.zebra.asan.660815-
./bgp_evpn_mh.test_evpn_mh/torm11.zebra.asan.660815-SUMMARY: AddressSanitizer: 128 byte(s) leaked in 4 allocation(s).
--
./bgp_evpn_mh.test_evpn_mh/hostd12.zebra.asan.667685:Direct leak of 40 byte(s) in 1 object(s) allocated from:
./bgp_evpn_mh.test_evpn_mh/hostd12.zebra.asan.667685-    #0 0x7fb3bf09f037 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
./bgp_evpn_mh.test_evpn_mh/hostd12.zebra.asan.667685-    FRRouting#1 0x7fb3bec451ee in qcalloc lib/memory.c:105
./bgp_evpn_mh.test_evpn_mh/hostd12.zebra.asan.667685-    FRRouting#2 0x7fb3bec1a33c in list_new lib/linklist.c:49
./bgp_evpn_mh.test_evpn_mh/hostd12.zebra.asan.667685-    FRRouting#3 0x559e90ee6525 in zebra_l2if_update_bond zebra/zebra_l2.c:223
./bgp_evpn_mh.test_evpn_mh/hostd12.zebra.asan.667685-    FRRouting#4 0x559e90e1f44d in netlink_interface zebra/if_netlink.c:1203
./bgp_evpn_mh.test_evpn_mh/hostd12.zebra.asan.667685-    FRRouting#5 0x559e90e4ebcf in netlink_parse_info zebra/kernel_netlink.c:1183
./bgp_evpn_mh.test_evpn_mh/hostd12.zebra.asan.667685-    FRRouting#6 0x559e90e1fcc1 in interface_lookup_netlink zebra/if_netlink.c:1273
./bgp_evpn_mh.test_evpn_mh/hostd12.zebra.asan.667685-    FRRouting#7 0x559e90e27b27 in interface_list zebra/if_netlink.c:2419
./bgp_evpn_mh.test_evpn_mh/hostd12.zebra.asan.667685-    FRRouting#8 0x559e90f56a77 in zebra_ns_enable zebra/zebra_ns.c:113
./bgp_evpn_mh.test_evpn_mh/hostd12.zebra.asan.667685-    FRRouting#9 0x559e90f56e76 in zebra_ns_init zebra/zebra_ns.c:205
./bgp_evpn_mh.test_evpn_mh/hostd12.zebra.asan.667685-    FRRouting#10 0x559e90e56b38 in main zebra/main.c:399
./bgp_evpn_mh.test_evpn_mh/hostd12.zebra.asan.667685-    FRRouting#11 0x7fb3be733d09 in __libc_start_main ../csu/libc-start.c:308
./bgp_evpn_mh.test_evpn_mh/hostd12.zebra.asan.667685-
./bgp_evpn_mh.test_evpn_mh/hostd12.zebra.asan.667685:Indirect leak of 48 byte(s) in 2 object(s) allocated from:
./bgp_evpn_mh.test_evpn_mh/hostd12.zebra.asan.667685-    #0 0x7fb3bf09f037 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
./bgp_evpn_mh.test_evpn_mh/hostd12.zebra.asan.667685-    FRRouting#1 0x7fb3bec451ee in qcalloc lib/memory.c:105
./bgp_evpn_mh.test_evpn_mh/hostd12.zebra.asan.667685-    FRRouting#2 0x7fb3bec1a43d in listnode_new lib/linklist.c:71
./bgp_evpn_mh.test_evpn_mh/hostd12.zebra.asan.667685-    FRRouting#3 0x7fb3bec1a780 in listnode_add lib/linklist.c:92
./bgp_evpn_mh.test_evpn_mh/hostd12.zebra.asan.667685-    FRRouting#4 0x559e90ee5fdf in zebra_l2_map_slave_to_bond zebra/zebra_l2.c:168
./bgp_evpn_mh.test_evpn_mh/hostd12.zebra.asan.667685-    FRRouting#5 0x559e90e3077d in zebra_if_update_all_links zebra/interface.c:1150
./bgp_evpn_mh.test_evpn_mh/hostd12.zebra.asan.667685-    FRRouting#6 0x559e90e1fd51 in interface_lookup_netlink zebra/if_netlink.c:1303
./bgp_evpn_mh.test_evpn_mh/hostd12.zebra.asan.667685-    FRRouting#7 0x559e90e27b27 in interface_list zebra/if_netlink.c:2419
./bgp_evpn_mh.test_evpn_mh/hostd12.zebra.asan.667685-    FRRouting#8 0x559e90f56a77 in zebra_ns_enable zebra/zebra_ns.c:113
./bgp_evpn_mh.test_evpn_mh/hostd12.zebra.asan.667685-    FRRouting#9 0x559e90f56e76 in zebra_ns_init zebra/zebra_ns.c:205
./bgp_evpn_mh.test_evpn_mh/hostd12.zebra.asan.667685-    FRRouting#10 0x559e90e56b38 in main zebra/main.c:399
./bgp_evpn_mh.test_evpn_mh/hostd12.zebra.asan.667685-    FRRouting#11 0x7fb3be733d09 in __libc_start_main ../csu/libc-start.c:308
./bgp_evpn_mh.test_evpn_mh/hostd12.zebra.asan.667685-
./bgp_evpn_mh.test_evpn_mh/hostd12.zebra.asan.667685-SUMMARY: AddressSanitizer: 88 byte(s) leaked in 3 allocation(s).
--
./bgp_evpn_mh.test_evpn_mh/hostd22.zebra.asan.670560:Direct leak of 40 byte(s) in 1 object(s) allocated from:
./bgp_evpn_mh.test_evpn_mh/hostd22.zebra.asan.670560-    #0 0x7faab58d4037 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
./bgp_evpn_mh.test_evpn_mh/hostd22.zebra.asan.670560-    FRRouting#1 0x7faab547a1ee in qcalloc lib/memory.c:105
./bgp_evpn_mh.test_evpn_mh/hostd22.zebra.asan.670560-    FRRouting#2 0x7faab544f33c in list_new lib/linklist.c:49
./bgp_evpn_mh.test_evpn_mh/hostd22.zebra.asan.670560-    FRRouting#3 0x5599ef7e5525 in zebra_l2if_update_bond zebra/zebra_l2.c:223
./bgp_evpn_mh.test_evpn_mh/hostd22.zebra.asan.670560-    FRRouting#4 0x5599ef71e44d in netlink_interface zebra/if_netlink.c:1203
./bgp_evpn_mh.test_evpn_mh/hostd22.zebra.asan.670560-    FRRouting#5 0x5599ef74dbcf in netlink_parse_info zebra/kernel_netlink.c:1183
./bgp_evpn_mh.test_evpn_mh/hostd22.zebra.asan.670560-    FRRouting#6 0x5599ef71ecc1 in interface_lookup_netlink zebra/if_netlink.c:1273
./bgp_evpn_mh.test_evpn_mh/hostd22.zebra.asan.670560-    FRRouting#7 0x5599ef726b27 in interface_list zebra/if_netlink.c:2419
./bgp_evpn_mh.test_evpn_mh/hostd22.zebra.asan.670560-    FRRouting#8 0x5599ef855a77 in zebra_ns_enable zebra/zebra_ns.c:113
./bgp_evpn_mh.test_evpn_mh/hostd22.zebra.asan.670560-    FRRouting#9 0x5599ef855e76 in zebra_ns_init zebra/zebra_ns.c:205
./bgp_evpn_mh.test_evpn_mh/hostd22.zebra.asan.670560-    FRRouting#10 0x5599ef755b38 in main zebra/main.c:399
./bgp_evpn_mh.test_evpn_mh/hostd22.zebra.asan.670560-    FRRouting#11 0x7faab4f68d09 in __libc_start_main ../csu/libc-start.c:308
./bgp_evpn_mh.test_evpn_mh/hostd22.zebra.asan.670560-
./bgp_evpn_mh.test_evpn_mh/hostd22.zebra.asan.670560:Indirect leak of 48 byte(s) in 2 object(s) allocated from:
./bgp_evpn_mh.test_evpn_mh/hostd22.zebra.asan.670560-    #0 0x7faab58d4037 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
./bgp_evpn_mh.test_evpn_mh/hostd22.zebra.asan.670560-    FRRouting#1 0x7faab547a1ee in qcalloc lib/memory.c:105
./bgp_evpn_mh.test_evpn_mh/hostd22.zebra.asan.670560-    FRRouting#2 0x7faab544f43d in listnode_new lib/linklist.c:71
./bgp_evpn_mh.test_evpn_mh/hostd22.zebra.asan.670560-    FRRouting#3 0x7faab544f780 in listnode_add lib/linklist.c:92
./bgp_evpn_mh.test_evpn_mh/hostd22.zebra.asan.670560-    FRRouting#4 0x5599ef7e4fdf in zebra_l2_map_slave_to_bond zebra/zebra_l2.c:168
./bgp_evpn_mh.test_evpn_mh/hostd22.zebra.asan.670560-    FRRouting#5 0x5599ef72f77d in zebra_if_update_all_links zebra/interface.c:1150
./bgp_evpn_mh.test_evpn_mh/hostd22.zebra.asan.670560-    FRRouting#6 0x5599ef71ed51 in interface_lookup_netlink zebra/if_netlink.c:1303
./bgp_evpn_mh.test_evpn_mh/hostd22.zebra.asan.670560-    FRRouting#7 0x5599ef726b27 in interface_list zebra/if_netlink.c:2419
./bgp_evpn_mh.test_evpn_mh/hostd22.zebra.asan.670560-    FRRouting#8 0x5599ef855a77 in zebra_ns_enable zebra/zebra_ns.c:113
./bgp_evpn_mh.test_evpn_mh/hostd22.zebra.asan.670560-    FRRouting#9 0x5599ef855e76 in zebra_ns_init zebra/zebra_ns.c:205
./bgp_evpn_mh.test_evpn_mh/hostd22.zebra.asan.670560-    FRRouting#10 0x5599ef755b38 in main zebra/main.c:399
./bgp_evpn_mh.test_evpn_mh/hostd22.zebra.asan.670560-    FRRouting#11 0x7faab4f68d09 in __libc_start_main ../csu/libc-start.c:308
./bgp_evpn_mh.test_evpn_mh/hostd22.zebra.asan.670560-
./bgp_evpn_mh.test_evpn_mh/hostd22.zebra.asan.670560-SUMMARY: AddressSanitizer: 88 byte(s) leaked in 3 allocation(s).
--
./bgp_evpn_mh.test_evpn_mh/torm22.zebra.asan.665413:Direct leak of 80 byte(s) in 2 object(s) allocated from:
./bgp_evpn_mh.test_evpn_mh/torm22.zebra.asan.665413-    #0 0x7fc5e175f037 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
./bgp_evpn_mh.test_evpn_mh/torm22.zebra.asan.665413-    FRRouting#1 0x7fc5e13051ee in qcalloc lib/memory.c:105
./bgp_evpn_mh.test_evpn_mh/torm22.zebra.asan.665413-    FRRouting#2 0x7fc5e12da33c in list_new lib/linklist.c:49
./bgp_evpn_mh.test_evpn_mh/torm22.zebra.asan.665413-    FRRouting#3 0x55e090b90525 in zebra_l2if_update_bond zebra/zebra_l2.c:223
./bgp_evpn_mh.test_evpn_mh/torm22.zebra.asan.665413-    FRRouting#4 0x55e090ac944d in netlink_interface zebra/if_netlink.c:1203
./bgp_evpn_mh.test_evpn_mh/torm22.zebra.asan.665413-    FRRouting#5 0x55e090af8bcf in netlink_parse_info zebra/kernel_netlink.c:1183
./bgp_evpn_mh.test_evpn_mh/torm22.zebra.asan.665413-    FRRouting#6 0x55e090ac9cc1 in interface_lookup_netlink zebra/if_netlink.c:1273
./bgp_evpn_mh.test_evpn_mh/torm22.zebra.asan.665413-    FRRouting#7 0x55e090ad1b27 in interface_list zebra/if_netlink.c:2419
./bgp_evpn_mh.test_evpn_mh/torm22.zebra.asan.665413-    FRRouting#8 0x55e090c00a77 in zebra_ns_enable zebra/zebra_ns.c:113
./bgp_evpn_mh.test_evpn_mh/torm22.zebra.asan.665413-    FRRouting#9 0x55e090c00e76 in zebra_ns_init zebra/zebra_ns.c:205
./bgp_evpn_mh.test_evpn_mh/torm22.zebra.asan.665413-    FRRouting#10 0x55e090b00b38 in main zebra/main.c:399
./bgp_evpn_mh.test_evpn_mh/torm22.zebra.asan.665413-    FRRouting#11 0x7fc5e0df3d09 in __libc_start_main ../csu/libc-start.c:308
./bgp_evpn_mh.test_evpn_mh/torm22.zebra.asan.665413-
./bgp_evpn_mh.test_evpn_mh/torm22.zebra.asan.665413:Indirect leak of 48 byte(s) in 2 object(s) allocated from:
./bgp_evpn_mh.test_evpn_mh/torm22.zebra.asan.665413-    #0 0x7fc5e175f037 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
./bgp_evpn_mh.test_evpn_mh/torm22.zebra.asan.665413-    FRRouting#1 0x7fc5e13051ee in qcalloc lib/memory.c:105
./bgp_evpn_mh.test_evpn_mh/torm22.zebra.asan.665413-    FRRouting#2 0x7fc5e12da43d in listnode_new lib/linklist.c:71
./bgp_evpn_mh.test_evpn_mh/torm22.zebra.asan.665413-    FRRouting#3 0x7fc5e12da780 in listnode_add lib/linklist.c:92
./bgp_evpn_mh.test_evpn_mh/torm22.zebra.asan.665413-    FRRouting#4 0x55e090b8ffdf in zebra_l2_map_slave_to_bond zebra/zebra_l2.c:168
./bgp_evpn_mh.test_evpn_mh/torm22.zebra.asan.665413-    FRRouting#5 0x55e090ada77d in zebra_if_update_all_links zebra/interface.c:1150
./bgp_evpn_mh.test_evpn_mh/torm22.zebra.asan.665413-    FRRouting#6 0x55e090ac9d51 in interface_lookup_netlink zebra/if_netlink.c:1303
./bgp_evpn_mh.test_evpn_mh/torm22.zebra.asan.665413-    FRRouting#7 0x55e090ad1b27 in interface_list zebra/if_netlink.c:2419
./bgp_evpn_mh.test_evpn_mh/torm22.zebra.asan.665413-    FRRouting#8 0x55e090c00a77 in zebra_ns_enable zebra/zebra_ns.c:113
./bgp_evpn_mh.test_evpn_mh/torm22.zebra.asan.665413-    FRRouting#9 0x55e090c00e76 in zebra_ns_init zebra/zebra_ns.c:205
./bgp_evpn_mh.test_evpn_mh/torm22.zebra.asan.665413-    FRRouting#10 0x55e090b00b38 in main zebra/main.c:399
./bgp_evpn_mh.test_evpn_mh/torm22.zebra.asan.665413-    FRRouting#11 0x7fc5e0df3d09 in __libc_start_main ../csu/libc-start.c:308
./bgp_evpn_mh.test_evpn_mh/torm22.zebra.asan.665413-
./bgp_evpn_mh.test_evpn_mh/torm22.zebra.asan.665413-SUMMARY: AddressSanitizer: 128 byte(s) leaked in 4 allocation(s).
--
./bgp_evpn_mh.test_evpn_mh/hostd21.zebra.asan.669024:Direct leak of 40 byte(s) in 1 object(s) allocated from:
./bgp_evpn_mh.test_evpn_mh/hostd21.zebra.asan.669024-    #0 0x7fe5c2019037 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
./bgp_evpn_mh.test_evpn_mh/hostd21.zebra.asan.669024-    FRRouting#1 0x7fe5c1bbf1ee in qcalloc lib/memory.c:105
./bgp_evpn_mh.test_evpn_mh/hostd21.zebra.asan.669024-    FRRouting#2 0x7fe5c1b9433c in list_new lib/linklist.c:49
./bgp_evpn_mh.test_evpn_mh/hostd21.zebra.asan.669024-    FRRouting#3 0x557ad92d0525 in zebra_l2if_update_bond zebra/zebra_l2.c:223
./bgp_evpn_mh.test_evpn_mh/hostd21.zebra.asan.669024-    FRRouting#4 0x557ad920944d in netlink_interface zebra/if_netlink.c:1203
./bgp_evpn_mh.test_evpn_mh/hostd21.zebra.asan.669024-    FRRouting#5 0x557ad9238bcf in netlink_parse_info zebra/kernel_netlink.c:1183
./bgp_evpn_mh.test_evpn_mh/hostd21.zebra.asan.669024-    FRRouting#6 0x557ad9209cc1 in interface_lookup_netlink zebra/if_netlink.c:1273
./bgp_evpn_mh.test_evpn_mh/hostd21.zebra.asan.669024-    FRRouting#7 0x557ad9211b27 in interface_list zebra/if_netlink.c:2419
./bgp_evpn_mh.test_evpn_mh/hostd21.zebra.asan.669024-    FRRouting#8 0x557ad9340a77 in zebra_ns_enable zebra/zebra_ns.c:113
./bgp_evpn_mh.test_evpn_mh/hostd21.zebra.asan.669024-    FRRouting#9 0x557ad9340e76 in zebra_ns_init zebra/zebra_ns.c:205
./bgp_evpn_mh.test_evpn_mh/hostd21.zebra.asan.669024-    FRRouting#10 0x557ad9240b38 in main zebra/main.c:399
./bgp_evpn_mh.test_evpn_mh/hostd21.zebra.asan.669024-    FRRouting#11 0x7fe5c16add09 in __libc_start_main ../csu/libc-start.c:308
./bgp_evpn_mh.test_evpn_mh/hostd21.zebra.asan.669024-
./bgp_evpn_mh.test_evpn_mh/hostd21.zebra.asan.669024:Indirect leak of 48 byte(s) in 2 object(s) allocated from:
./bgp_evpn_mh.test_evpn_mh/hostd21.zebra.asan.669024-    #0 0x7fe5c2019037 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
./bgp_evpn_mh.test_evpn_mh/hostd21.zebra.asan.669024-    FRRouting#1 0x7fe5c1bbf1ee in qcalloc lib/memory.c:105
./bgp_evpn_mh.test_evpn_mh/hostd21.zebra.asan.669024-    FRRouting#2 0x7fe5c1b9443d in listnode_new lib/linklist.c:71
./bgp_evpn_mh.test_evpn_mh/hostd21.zebra.asan.669024-    FRRouting#3 0x7fe5c1b94780 in listnode_add lib/linklist.c:92
./bgp_evpn_mh.test_evpn_mh/hostd21.zebra.asan.669024-    FRRouting#4 0x557ad92cffdf in zebra_l2_map_slave_to_bond zebra/zebra_l2.c:168
./bgp_evpn_mh.test_evpn_mh/hostd21.zebra.asan.669024-    FRRouting#5 0x557ad921a77d in zebra_if_update_all_links zebra/interface.c:1150
./bgp_evpn_mh.test_evpn_mh/hostd21.zebra.asan.669024-    FRRouting#6 0x557ad9209d51 in interface_lookup_netlink zebra/if_netlink.c:1303
./bgp_evpn_mh.test_evpn_mh/hostd21.zebra.asan.669024-    FRRouting#7 0x557ad9211b27 in interface_list zebra/if_netlink.c:2419
./bgp_evpn_mh.test_evpn_mh/hostd21.zebra.asan.669024-    FRRouting#8 0x557ad9340a77 in zebra_ns_enable zebra/zebra_ns.c:113
./bgp_evpn_mh.test_evpn_mh/hostd21.zebra.asan.669024-    FRRouting#9 0x557ad9340e76 in zebra_ns_init zebra/zebra_ns.c:205
./bgp_evpn_mh.test_evpn_mh/hostd21.zebra.asan.669024-    FRRouting#10 0x557ad9240b38 in main zebra/main.c:399
./bgp_evpn_mh.test_evpn_mh/hostd21.zebra.asan.669024-    FRRouting#11 0x7fe5c16add09 in __libc_start_main ../csu/libc-start.c:308
./bgp_evpn_mh.test_evpn_mh/hostd21.zebra.asan.669024-
./bgp_evpn_mh.test_evpn_mh/hostd21.zebra.asan.669024-SUMMARY: AddressSanitizer: 88 byte(s) leaked in 3 allocation(s).
--
./bgp_evpn_mh.test_evpn_mh/hostd11.zebra.asan.666551:Direct leak of 40 byte(s) in 1 object(s) allocated from:
./bgp_evpn_mh.test_evpn_mh/hostd11.zebra.asan.666551-    #0 0x7f1fc2399037 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
./bgp_evpn_mh.test_evpn_mh/hostd11.zebra.asan.666551-    FRRouting#1 0x7f1fc1f3f1ee in qcalloc lib/memory.c:105
./bgp_evpn_mh.test_evpn_mh/hostd11.zebra.asan.666551-    FRRouting#2 0x7f1fc1f1433c in list_new lib/linklist.c:49
./bgp_evpn_mh.test_evpn_mh/hostd11.zebra.asan.666551-    FRRouting#3 0x559cd8f0b525 in zebra_l2if_update_bond zebra/zebra_l2.c:223
./bgp_evpn_mh.test_evpn_mh/hostd11.zebra.asan.666551-    FRRouting#4 0x559cd8e4444d in netlink_interface zebra/if_netlink.c:1203
./bgp_evpn_mh.test_evpn_mh/hostd11.zebra.asan.666551-    FRRouting#5 0x559cd8e73bcf in netlink_parse_info zebra/kernel_netlink.c:1183
./bgp_evpn_mh.test_evpn_mh/hostd11.zebra.asan.666551-    FRRouting#6 0x559cd8e44cc1 in interface_lookup_netlink zebra/if_netlink.c:1273
./bgp_evpn_mh.test_evpn_mh/hostd11.zebra.asan.666551-    FRRouting#7 0x559cd8e4cb27 in interface_list zebra/if_netlink.c:2419
./bgp_evpn_mh.test_evpn_mh/hostd11.zebra.asan.666551-    FRRouting#8 0x559cd8f7ba77 in zebra_ns_enable zebra/zebra_ns.c:113
./bgp_evpn_mh.test_evpn_mh/hostd11.zebra.asan.666551-    FRRouting#9 0x559cd8f7be76 in zebra_ns_init zebra/zebra_ns.c:205
./bgp_evpn_mh.test_evpn_mh/hostd11.zebra.asan.666551-    FRRouting#10 0x559cd8e7bb38 in main zebra/main.c:399
./bgp_evpn_mh.test_evpn_mh/hostd11.zebra.asan.666551-    FRRouting#11 0x7f1fc1a2dd09 in __libc_start_main ../csu/libc-start.c:308
./bgp_evpn_mh.test_evpn_mh/hostd11.zebra.asan.666551-
./bgp_evpn_mh.test_evpn_mh/hostd11.zebra.asan.666551:Indirect leak of 48 byte(s) in 2 object(s) allocated from:
./bgp_evpn_mh.test_evpn_mh/hostd11.zebra.asan.666551-    #0 0x7f1fc2399037 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
./bgp_evpn_mh.test_evpn_mh/hostd11.zebra.asan.666551-    FRRouting#1 0x7f1fc1f3f1ee in qcalloc lib/memory.c:105
./bgp_evpn_mh.test_evpn_mh/hostd11.zebra.asan.666551-    FRRouting#2 0x7f1fc1f1443d in listnode_new lib/linklist.c:71
./bgp_evpn_mh.test_evpn_mh/hostd11.zebra.asan.666551-    FRRouting#3 0x7f1fc1f14780 in listnode_add lib/linklist.c:92
./bgp_evpn_mh.test_evpn_mh/hostd11.zebra.asan.666551-    FRRouting#4 0x559cd8f0afdf in zebra_l2_map_slave_to_bond zebra/zebra_l2.c:168
./bgp_evpn_mh.test_evpn_mh/hostd11.zebra.asan.666551-    FRRouting#5 0x559cd8e5577d in zebra_if_update_all_links zebra/interface.c:1150
./bgp_evpn_mh.test_evpn_mh/hostd11.zebra.asan.666551-    FRRouting#6 0x559cd8e44d51 in interface_lookup_netlink zebra/if_netlink.c:1303
./bgp_evpn_mh.test_evpn_mh/hostd11.zebra.asan.666551-    FRRouting#7 0x559cd8e4cb27 in interface_list zebra/if_netlink.c:2419
./bgp_evpn_mh.test_evpn_mh/hostd11.zebra.asan.666551-    FRRouting#8 0x559cd8f7ba77 in zebra_ns_enable zebra/zebra_ns.c:113
./bgp_evpn_mh.test_evpn_mh/hostd11.zebra.asan.666551-    FRRouting#9 0x559cd8f7be76 in zebra_ns_init zebra/zebra_ns.c:205
./bgp_evpn_mh.test_evpn_mh/hostd11.zebra.asan.666551-    FRRouting#10 0x559cd8e7bb38 in main zebra/main.c:399
./bgp_evpn_mh.test_evpn_mh/hostd11.zebra.asan.666551-    FRRouting#11 0x7f1fc1a2dd09 in __libc_start_main ../csu/libc-start.c:308
./bgp_evpn_mh.test_evpn_mh/hostd11.zebra.asan.666551-
./bgp_evpn_mh.test_evpn_mh/hostd11.zebra.asan.666551-SUMMARY: AddressSanitizer: 88 byte(s) leaked in 3 allocation(s).
```

Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
20 months agopimd: Prevent vxlan from causing a S,G RPT Prune in some cases
Donald Sharp [Sat, 12 Aug 2023 04:06:51 +0000 (00:06 -0400)]
pimd: Prevent vxlan from causing a S,G RPT Prune in some cases

Upon startup the pim vxlan code initiates a pim null register
send for the S,G and sends a *,G join towards the RP at the same
time.  Since a S,G upstream is created in the vxlan code with
the appropriate flags, the *,G join has the embedded S,G RPT
Prune.  When an intermediate route receives this *,G RPT Prune
it creates a blackhole S,G route since this particular intermediate
router has not received a join from the RP yet( say the packet is
lost, or that part of the network is slower coming up ).

Let's try to intelligently decide that the S,G RPT Prune
should not be sent as part of the *,G join until the actual
S,G join from the RP reaches this box.  Then we can make
intelligent decisions about whether or not to send it
out.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
20 months agotests: Make bgp_evpn_mh a 3 level clos
Donald Sharp [Sat, 12 Aug 2023 03:51:07 +0000 (23:51 -0400)]
tests: Make bgp_evpn_mh a 3 level clos

The tests were originally tor --- spine
lets add a tor -- leaf -- spine.  At this
point this change was to allow me to test
some funkiness I am seeing in pim vxlan setups
when the leaf is acting as the intermediate routers.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
20 months agoMerge pull request #14182 from donaldsharp/bgp_evpn_lock_problem
Jafar Al-Gharaibeh [Sat, 12 Aug 2023 00:52:37 +0000 (19:52 -0500)]
Merge pull request #14182 from donaldsharp/bgp_evpn_lock_problem

bgpd: evpn code was not properly unlocking rd_dest

20 months agodoc: Prohibit usage of `system()` calls in FRR
Donald Sharp [Fri, 11 Aug 2023 16:40:40 +0000 (12:40 -0400)]
doc: Prohibit usage of `system()` calls in FRR

See the documentation update, but system() calls and
it's ilk block the processing of SIGINT and they are
not properly handled as a result leading to shutdown
issues where one or more daemons never stop.

See aa530b627de8d1d8c11e4455f3e97a8c2e045281 as an example
of system call usage removed from the system.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
20 months agoMerge pull request #14176 from pguibert6WIND/mpls_yang_enable_disable
Donatas Abraitis [Fri, 11 Aug 2023 15:36:35 +0000 (18:36 +0300)]
Merge pull request #14176 from pguibert6WIND/mpls_yang_enable_disable

Mpls yang enable disable

20 months agovtysh: Print uniq lines when parsing `no service ...`
Donatas Abraitis [Fri, 11 Aug 2023 15:21:12 +0000 (18:21 +0300)]
vtysh: Print uniq lines when parsing `no service ...`

Before this patch:

```
no service cputime-warning
no service cputime-warning
no ipv6 forwarding
no service cputime-warning
no service cputime-warning
no service cputime-warning
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
20 months agozebra: Remove tag from zebra_rmap_obj
Donald Sharp [Fri, 11 Aug 2023 15:21:03 +0000 (11:21 -0400)]
zebra: Remove tag from zebra_rmap_obj

The tag value in all cases was being set to the re->tag.
re is already stored, so let's just use that.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
20 months agozebra: Use the re->metric instead of 0 for zebra_rmap_obj
Donald Sharp [Fri, 11 Aug 2023 15:17:29 +0000 (11:17 -0400)]
zebra: Use the re->metric instead of 0 for zebra_rmap_obj

The zebra_rmap_obj was storing the re->metric and allowing
matches against it, but in most cases it was just using 0.
Use the Route entries metric instead.  This should fix
some bugs where a match metric never worked.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
20 months agozebra: Remove instance from zebra_rmap_obj data structure
Donald Sharp [Fri, 11 Aug 2023 15:15:06 +0000 (11:15 -0400)]
zebra: Remove instance from zebra_rmap_obj data structure

In all cases the instance is derived from the re pointer
and since the re pointer is already stored, let's just
remove it from the game and cut to the chase.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
20 months agozebra: Replace source_protocol with just using re in route map object
Donald Sharp [Fri, 11 Aug 2023 15:11:40 +0000 (11:11 -0400)]
zebra: Replace source_protocol with just using re in route map object

Replace the source_protocol with just saving a pointer to the re
in the `struct zebra_rmap_obj` data structure.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
20 months agolib: Allow unsetting walltime-warning and cpu-warning
Donatas Abraitis [Fri, 11 Aug 2023 15:11:03 +0000 (18:11 +0300)]
lib: Allow unsetting walltime-warning and cpu-warning

With a negative form we get:

```
Internal CLI error [walltime_warning_str]
Internal CLI error [cputime_warning_str]
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
20 months agozebra: Remove vrf_id from passed around object
Donald Sharp [Fri, 11 Aug 2023 15:06:04 +0000 (11:06 -0400)]
zebra: Remove vrf_id from passed around object

The nexthop that is stored already knows it's nexthop and
in all cases the vrf id is derived from the nexthop->vrf_id
let's just cut to the chase and not do this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
20 months agozebra: import table match against interface name could fail
Donald Sharp [Fri, 11 Aug 2023 14:18:41 +0000 (10:18 -0400)]
zebra: import table match against interface name could fail

If an import table route-map is trying to match against
a particular interface, The code is matching against
the actual vrf the route entry is in -vs- the vrf
the nexthop entry is in.  Let's modify the code
to actually allow the import table entry to match
against the nexthops vrf.

Not working:

ip import-table 91
ip import-table 93 route-map FOO
no service integrated-vtysh-config
!
debug zebra events
!
interface green
 ip address 192.168.4.3/24
exit
!
route-map FOO permit 10
 match interface green
exit

eva# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

K>* 0.0.0.0/0 [0/100] via 192.168.119.1, enp13s0, 1d10h07m
T[91]>* 1.2.3.5/32 [15/0] via 192.168.119.1, enp13s0, 00:00:05
K>* 169.254.0.0/16 [0/1000] is directly connected, virbr0 linkdown, 1d16h34m
C>* 192.168.44.0/24 is directly connected, virbr1, 01:30:51
C>* 192.168.45.0/24 is directly connected, virbr2, 01:30:51
C>* 192.168.119.0/24 is directly connected, enp13s0, 1d16h34m
C>* 192.168.122.0/24 is directly connected, virbr0 linkdown, 01:30:51
eva# show ip route table 91
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

VRF default table 91:
K>* 1.2.3.5/32 [0/0] via 192.168.119.1, enp13s0, 00:00:15
eva# show ip route table 93
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

VRF default table 93:
K * 1.2.3.4/32 [0/0] via 192.168.4.5, green (vrf green), 00:03:05

Working:

eva# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

K>* 0.0.0.0/0 [0/100] via 192.168.119.1, enp13s0, 00:03:09
T[93]>* 1.2.3.4/32 [15/0] via 192.168.4.5, green (vrf green), 00:02:21
T[91]>* 1.2.3.5/32 [15/0] via 192.168.119.1, enp13s0, 00:02:26
K>* 169.254.0.0/16 [0/1000] is directly connected, virbr0, 00:03:09
C>* 192.168.44.0/24 is directly connected, virbr1, 00:03:09
C>* 192.168.45.0/24 is directly connected, virbr2, 00:03:09
C>* 192.168.119.0/24 is directly connected, enp13s0, 00:03:09
C>* 192.168.122.0/24 is directly connected, virbr0, 00:03:09
eva# show ip route table 91
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

VRF default table 91:
K * 1.2.3.5/32 [0/0] via 192.168.119.1, enp13s0, 00:03:12
eva# show ip route table 93
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

VRF default table 93:
K * 1.2.3.4/32 [0/0] via 192.168.4.5, green (vrf green), 00:03:14

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
20 months agozebra: Rename `struct nh_rmap_obj` to `struct zebra_rmap_obj`
Donald Sharp [Fri, 11 Aug 2023 14:12:06 +0000 (10:12 -0400)]
zebra: Rename `struct nh_rmap_obj` to `struct zebra_rmap_obj`

This structure is really the generic route map object for
handling routemaps in zebra.  Let's name it appropriately.
Future commits will consolidate the data to using the
struct route_entry as part of this data instead of copying
bits and bobs of it.  This will allow future work to
set/control the route_entry more directly.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
20 months agobgpd: evpn code was not properly unlocking rd_dest
Donald Sharp [Fri, 11 Aug 2023 13:53:42 +0000 (09:53 -0400)]
bgpd: evpn code was not properly unlocking rd_dest

Found some code where bgp was not unlocking the dest
and rd_dest when walking the tree attempting to
find something to install.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
20 months agobgpd: Assign explicit-null for default-originate according to the AFI
Donatas Abraitis [Fri, 11 Aug 2023 07:49:14 +0000 (10:49 +0300)]
bgpd: Assign explicit-null for default-originate according to the AFI

RFC 3032 defines:

A value of 2 represents the "IPv6 Explicit NULL Label".
This label value is only legal at the bottom of the label
stack.  It indicates that the label stack must be popped,
and the forwarding of the packet must then be based on the
IPv6 header.

Before this patch we set 128, but it was even more wrong, because it was sent
in host-byte order, not the network-byte.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
20 months agotests: Check if labeled IPv6 unicast default route works too
Donatas Abraitis [Fri, 11 Aug 2023 07:48:28 +0000 (10:48 +0300)]
tests: Check if labeled IPv6 unicast default route works too

Also, check if remote label is explicit null according to the AFI.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
20 months agotopotests: add static mpls routing test
Philippe Guibert [Fri, 4 Aug 2023 10:00:08 +0000 (12:00 +0200)]
topotests: add static mpls routing test

There is no test that checks for the mpls interface
configuration.
The new test checks that mpls configuration per
interface works when value is enabled or disabled.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
20 months agodoc: update mpls per interface command
Philippe Guibert [Mon, 31 Jul 2023 20:26:54 +0000 (22:26 +0200)]
doc: update mpls per interface command

Update mpls per interface command information.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
20 months agozebra, yang: add an mpls leaf to interface
Philippe Guibert [Sun, 9 Jul 2023 19:44:03 +0000 (21:44 +0200)]
zebra, yang: add an mpls leaf to interface

The yang NB API does not handle the mpls configuration
on its leaf.
Add an mpls leaf to stick to the mpls configuration.
- true or false to mean if config
- not defined, means no config.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
20 months agozebra: fix 'no mpls' command by using 'mpls disable' instead
Philippe Guibert [Thu, 13 Jul 2023 07:42:55 +0000 (09:42 +0200)]
zebra: fix 'no mpls' command by using 'mpls disable' instead

The 'no mpls' command wrongly assumes the user wants to disable
the mpls handling on the interface whereas this is just a config
knob that should mean 'I don't care with mpls'.

Fix this by adding a 'disable' option to the mpls command.

Fixes: 39ffa8e8e856 ("zebra: Add a `mpls enable` interface node command")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
20 months agoMerge pull request #14171 from mjstapp/fix_bgp_lblpool_indent
Donatas Abraitis [Thu, 10 Aug 2023 13:20:28 +0000 (16:20 +0300)]
Merge pull request #14171 from mjstapp/fix_bgp_lblpool_indent

bgpd: fix whitespace/indent in bgp_labelpool module

20 months agoMerge pull request #14170 from mjstapp/fix_bitfield_mtype
Donatas Abraitis [Thu, 10 Aug 2023 11:17:28 +0000 (14:17 +0300)]
Merge pull request #14170 from mjstapp/fix_bitfield_mtype

libs: use XREALLOC in bitfield lib module

20 months agoMerge pull request #14169 from qlyoung/amalgamate-checkping
Donald Sharp [Wed, 9 Aug 2023 23:47:56 +0000 (19:47 -0400)]
Merge pull request #14169 from qlyoung/amalgamate-checkping

tests: amalgamate check_ping

20 months agobgpd: fix whitespace/indent in bgp_labelpool module
Mark Stapp [Wed, 9 Aug 2023 21:01:16 +0000 (17:01 -0400)]
bgpd: fix whitespace/indent in bgp_labelpool module

Fix some weird indentation in the bgp labelpool module.

Signed-off-by: Mark Stapp <mjs@labn.net>
20 months agolibs: use XREALLOC in bitfield lib module
Mark Stapp [Wed, 9 Aug 2023 20:19:40 +0000 (16:19 -0400)]
libs: use XREALLOC in bitfield lib module

Use FRR mem api instead of raw realloc() in bitfield module.

Signed-off-by: Mark Stapp <mjs@labn.net>
20 months agotests: amalgamate check_ping
Quentin Young [Wed, 9 Aug 2023 19:45:56 +0000 (15:45 -0400)]
tests: amalgamate check_ping

❌✂️📋

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
20 months agopbrd: add packet mangling actions (src/dst ip-addr/port, dscp, ecn)
G. Paul Ziemba [Tue, 1 Aug 2023 18:00:52 +0000 (11:00 -0700)]
pbrd: add packet mangling actions (src/dst ip-addr/port, dscp, ecn)

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
20 months agopbrd: use flags to indicate active fields
G. Paul Ziemba [Mon, 31 Jul 2023 04:33:10 +0000 (21:33 -0700)]
pbrd: use flags to indicate active fields

    Before now, PBRD used non-zero values to imply that a rule's
    match or action field was active. This approach was getting
    cumbersome for fields where 0 is a valid active value and
    various field-specific magic values had to be used.

    This commit changes PBRD to use a flag bit per field to
    indicate that the field is active.

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
20 months agoMerge pull request #14073 from fdumontet6WIND/as_path_replace_reg
Donatas Abraitis [Wed, 9 Aug 2023 12:28:58 +0000 (15:28 +0300)]
Merge pull request #14073 from fdumontet6WIND/as_path_replace_reg

  bgpd: add set as-path replace acl-list command

20 months agoMerge pull request #14099 from lkClare/formated_sync_0727
Donatas Abraitis [Wed, 9 Aug 2023 11:46:48 +0000 (14:46 +0300)]
Merge pull request #14099 from lkClare/formated_sync_0727

bgpd: bgp_path_info_extra memory optimization

20 months agodoc: set as-path replace as-path-access-list
Francois Dumontet [Fri, 21 Jul 2023 13:38:21 +0000 (15:38 +0200)]
doc: set as-path replace as-path-access-list

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
20 months agopbrd: add explicit 'family' field for rules
G. Paul Ziemba [Mon, 31 Jul 2023 02:14:01 +0000 (19:14 -0700)]
pbrd: add explicit 'family' field for rules

    In the netlink-mediated kernel dataplane, each rule is stored
    in either an IPv4-specific database or an IPv6-specific database.
    PBRD opportunistically gleans each rule's address family value
    from its source or destination IP address match value (if either
    exists), or from its nexthop or nexthop-group (if it exists).

    The 'family' value is particularly needed for netlink during
    incremental rule deletion when none of the above fields remain set.

    Before now, this address family has been encoded by occult means
    in the (possibly otherwise unset) source/destination IP match
    fields in ZAPI and zebra.

    This commit documents the reasons for maintaining the 'family'
    field in the PBRD rule structure, adds a 'family' field in the
    common lib/pbr.h rule structure, and carries it explicitly in ZAPI.

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
20 months agopbrd: PBR_FILTER_DSFIELD -> {PBR_FILTER_DSCP,PBR_FILTER_ECN}
G. Paul Ziemba [Tue, 1 Aug 2023 13:49:38 +0000 (06:49 -0700)]
pbrd: PBR_FILTER_DSFIELD -> {PBR_FILTER_DSCP,PBR_FILTER_ECN}

    DSCP and ECN matching are configured independently. Maintain
    these values in independent fields in pbrd, zapi, and zebra.

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
20 months agopbrd: add nexthop drop type
G. Paul Ziemba [Sun, 30 Jul 2023 19:14:05 +0000 (12:14 -0700)]
pbrd: add nexthop drop type

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
20 months agoMerge pull request #14161 from opensourcerouting/fix/comment
Mark Stapp [Tue, 8 Aug 2023 16:36:58 +0000 (12:36 -0400)]
Merge pull request #14161 from opensourcerouting/fix/comment

bgpd: Fix RFC number in a comment

20 months agoMerge pull request #14154 from opensourcerouting/feature/bgpd_handle_role_capability_...
Russ White [Tue, 8 Aug 2023 14:47:04 +0000 (10:47 -0400)]
Merge pull request #14154 from opensourcerouting/feature/bgpd_handle_role_capability_using_dynamic_capability

bgpd: Handle role capability using dynamic capability

20 months agoMerge pull request #14158 from donaldsharp/listnode_stuff
Donatas Abraitis [Tue, 8 Aug 2023 13:31:57 +0000 (16:31 +0300)]
Merge pull request #14158 from donaldsharp/listnode_stuff

ospfd: Ensure listnode returns are usable

20 months agobgpd: Fix RFC number in a comment
Donatas Abraitis [Tue, 8 Aug 2023 13:31:12 +0000 (16:31 +0300)]
bgpd: Fix RFC number in a comment

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
20 months agobgpd: bgp_path_info_extra memory optimization
Valerian_He [Tue, 8 Aug 2023 10:47:29 +0000 (10:47 +0000)]
bgpd: bgp_path_info_extra memory optimization

Even if some of the attributes in bgp_path_info_extra are
not used, their memory is still allocated every time. It
cause a waste of memory.
This commit code deletes all unnecessary attributes and
changes the optional attributes to pointer storage. Memory
will only be allocated when they are actually used. After
optimization, extra info related memory is reduced by about
half(~400B -> ~200B).

Signed-off-by: Valerian_He <1826906282@qq.com>
20 months agoMerge pull request #14157 from donaldsharp/blargle_smargle
Donatas Abraitis [Tue, 8 Aug 2023 10:03:34 +0000 (13:03 +0300)]
Merge pull request #14157 from donaldsharp/blargle_smargle

bgpd: bgp_vrf is already deref'ed in all paths

20 months agoospfd: Ensure listnode returns are usable
Donald Sharp [Mon, 7 Aug 2023 19:57:29 +0000 (15:57 -0400)]
ospfd: Ensure listnode returns are usable

Coverity is complaining that listnode can return a NULL
value and thus FRR could derefence the returned value.
Since this is not crashing we know that this is not happening
in the wild.  Let's make this an assert or check that it is
legal to use the value.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
20 months agoMerge pull request #14153 from idryzhov/vtysh-empty-interface
Donald Sharp [Mon, 7 Aug 2023 19:48:00 +0000 (15:48 -0400)]
Merge pull request #14153 from idryzhov/vtysh-empty-interface

vtysh: fix checking empty interface node

20 months agolib: pbr.h: remove unused PBR_FILTER_PROTO
G. Paul Ziemba [Sun, 30 Jul 2023 18:52:57 +0000 (11:52 -0700)]
lib: pbr.h: remove unused PBR_FILTER_PROTO

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
20 months agopbrd: pbr_vty.c organize/style
G. Paul Ziemba [Thu, 27 Jul 2023 18:15:39 +0000 (11:15 -0700)]
pbrd: pbr_vty.c organize/style

    No functional changes: just arrange CLI handlers into logical
    order and standardize DEFPY formatting.

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
20 months agoMerge pull request #14155 from LabNConsulting/ziemba-zebra-pbr-ctx-common
Donald Sharp [Mon, 7 Aug 2023 19:15:25 +0000 (15:15 -0400)]
Merge pull request #14155 from LabNConsulting/ziemba-zebra-pbr-ctx-common

zebra: zebra_dplane.[ch]: use pbr common struct in ctx

20 months agobgpd: bgp_vrf is already deref'ed in all paths
Donald Sharp [Mon, 7 Aug 2023 19:11:05 +0000 (15:11 -0400)]
bgpd: bgp_vrf is already deref'ed in all paths

The usage of bgp_vrf does not need to be tested
at this point since it's already been derefed in all
paths to this point.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
20 months agozebra: zebra_dplane.[ch]: use pbr common struct in ctx
G. Paul Ziemba [Sun, 6 Aug 2023 15:51:01 +0000 (08:51 -0700)]
zebra: zebra_dplane.[ch]: use pbr common struct in ctx

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
20 months agotests: add one test to bgp_set_aspath_replace.py
Francois Dumontet [Mon, 17 Jul 2023 15:48:49 +0000 (17:48 +0200)]
tests: add one test to bgp_set_aspath_replace.py

add support of  set as-path replace as-path-access-list

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
20 months agobgpd: add set as-path exclude acl-list command
Francois Dumontet [Tue, 11 Jul 2023 08:03:04 +0000 (10:03 +0200)]
bgpd: add set as-path exclude acl-list command

A route-map applied on incoming BGP updates is not able
to replace an unwanted as segments by another one.
unwanted as segment are based on an AS path access-list.

The below configuration illustrates the case:

router bgp 65001

address-family ipv4 unicast
 neighbor 192.168.1.2 route-map rule_2 in
exit-address-family

bgp as-path access-list RULE permit ^65

route-map rule_2 permit 10
 set as-path replace as-path-access-list RULE 6000

```
BGP routing table entry for 10.10.10.10/32, version 13
Paths: (1 available, best #1, table default)
  Advertised to non peer-group peers:
  192.168.10.65
  65000 1 2 3 123
    192.168.10.65 from 192.168.10.65 (10.10.10.11)
      Origin IGP, metric 0, valid, external, best (First path received)
```

After:

```
do show ip bgp 10.10.10.10/32
BGP routing table entry for 10.10.10.10/32, version 15
    Paths: (1 available, best #1, table default)
      Advertised to non peer-group peers:
      192.168.10.65
      6000 1 2 3 123
        192.168.10.65 from 192.168.10.65 (10.10.10.11)
          Origin IGP, metric 0, valid, external, best (First path
          received)
```

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
20 months agoMerge pull request #14151 from opensourcerouting/fix/improve_addpath_selected_test
Donald Sharp [Sun, 6 Aug 2023 21:01:16 +0000 (17:01 -0400)]
Merge pull request #14151 from opensourcerouting/fix/improve_addpath_selected_test

tests: Improve bgp_addpath_best_selected topotest

20 months agoMerge pull request #14152 from idryzhov/vtysh-filter
Donatas Abraitis [Sun, 6 Aug 2023 17:14:13 +0000 (20:14 +0300)]
Merge pull request #14152 from idryzhov/vtysh-filter

vtysh: remove unused cmd_filter_type

20 months agoMerge pull request #14139 from donaldsharp/v6_v4_nexthops
Donatas Abraitis [Sun, 6 Aug 2023 17:11:19 +0000 (20:11 +0300)]
Merge pull request #14139 from donaldsharp/v6_v4_nexthops

V6 v4 nexthops

20 months agoMerge pull request #14149 from donaldsharp/cleanup_bad_commands
Donatas Abraitis [Sun, 6 Aug 2023 17:10:23 +0000 (20:10 +0300)]
Merge pull request #14149 from donaldsharp/cleanup_bad_commands

Cleanup bad commands

20 months agobgpd: Check if peer is established and dynamic capability-aware
Donatas Abraitis [Sat, 5 Aug 2023 20:00:55 +0000 (23:00 +0300)]
bgpd: Check if peer is established and dynamic capability-aware

Add this logic inside bgp_capability_send() instead of repeating the whole
logic before calling bgp_capability_send().

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
20 months agotests: Check if role capability is exchanged via dynamic capability
Donatas Abraitis [Sat, 5 Aug 2023 19:54:55 +0000 (22:54 +0300)]
tests: Check if role capability is exchanged via dynamic capability

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
20 months agobgpd: Handle role capability using dynamic capability
Donatas Abraitis [Sat, 5 Aug 2023 19:32:57 +0000 (22:32 +0300)]
bgpd: Handle role capability using dynamic capability

When setting local-role for the neighbor, force sending ROLE capability via
dynamic capability if it's enabled.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
20 months agovtysh: fix checking empty interface node
Igor Ryzhov [Fri, 4 Aug 2023 21:46:45 +0000 (00:46 +0300)]
vtysh: fix checking empty interface node

vtysh is not supposed to show empty interface node in running config,
however the corresponding check is broken and empty nodes are shown.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>