]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
21 months agoospf6d: Fix crash because neighbor structure was freed
Donald Sharp [Sat, 1 Jul 2023 15:18:06 +0000 (11:18 -0400)]
ospf6d: Fix crash because neighbor structure was freed

The loading_done event needs a event pointer to prevent
use after free's.  Testing found this:

    ERROR: AddressSanitizer: heap-use-after-free on address 0x613000035130 at pc 0x55ad42d54e5f bp 0x7ffff1e942a0 sp 0x7ffff1e94290
    READ of size 1 at 0x613000035130 thread T0
        #0 0x55ad42d54e5e in loading_done ospf6d/ospf6_neighbor.c:447
        #1 0x55ad42ed7be4 in event_call lib/event.c:1995
        #2 0x55ad42e1df75 in frr_run lib/libfrr.c:1213
        #3 0x55ad42cf332e in main ospf6d/ospf6_main.c:250
        #4 0x7f5798133c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
        #5 0x55ad42cf2b19 in _start (/usr/lib/frr/ospf6d+0x248b19)

    0x613000035130 is located 48 bytes inside of 384-byte region [0x613000035100,0x613000035280)
    freed by thread T0 here:
        #0 0x7f57998d77a8 in __interceptor_free (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xde7a8)
        #1 0x55ad42e3b4b6 in qfree lib/memory.c:130
        #2 0x55ad42d5d049 in ospf6_neighbor_delete ospf6d/ospf6_neighbor.c:180
        #3 0x55ad42d1e1ea in interface_down ospf6d/ospf6_interface.c:930
        #4 0x55ad42ed7be4 in event_call lib/event.c:1995
        #5 0x55ad42ed84fe in _event_execute lib/event.c:2086
        #6 0x55ad42d26d7b in ospf6_interface_clear ospf6d/ospf6_interface.c:2847
        #7 0x55ad42d73f16 in ospf6_process_reset ospf6d/ospf6_top.c:755
        #8 0x55ad42d7e98c in clear_router_ospf6_magic ospf6d/ospf6_top.c:778
        #9 0x55ad42d7e98c in clear_router_ospf6 ospf6d/ospf6_top_clippy.c:42
        #10 0x55ad42dc2665 in cmd_execute_command_real lib/command.c:994
        #11 0x55ad42dc2b32 in cmd_execute_command lib/command.c:1053
        #12 0x55ad42dc2fa9 in cmd_execute lib/command.c:1221
        #13 0x55ad42ee3cd6 in vty_command lib/vty.c:591
        #14 0x55ad42ee4170 in vty_execute lib/vty.c:1354
        #15 0x55ad42eec94f in vtysh_read lib/vty.c:2362
        #16 0x55ad42ed7be4 in event_call lib/event.c:1995
        #17 0x55ad42e1df75 in frr_run lib/libfrr.c:1213
        #18 0x55ad42cf332e in main ospf6d/ospf6_main.c:250
        #19 0x7f5798133c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

    previously allocated by thread T0 here:
        #0 0x7f57998d7d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
        #1 0x55ad42e3ab22 in qcalloc lib/memory.c:105
        #2 0x55ad42d5c8ff in ospf6_neighbor_create ospf6d/ospf6_neighbor.c:119
        #3 0x55ad42d4c86a in ospf6_hello_recv ospf6d/ospf6_message.c:464
        #4 0x55ad42d4c86a in ospf6_read_helper ospf6d/ospf6_message.c:1884
        #5 0x55ad42d4c86a in ospf6_receive ospf6d/ospf6_message.c:1925
        #6 0x55ad42ed7be4 in event_call lib/event.c:1995
        #7 0x55ad42e1df75 in frr_run lib/libfrr.c:1213
        #8 0x55ad42cf332e in main ospf6d/ospf6_main.c:250
        #9 0x7f5798133c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Add an actual event pointer and just track it appropriately.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
22 months agoMerge pull request #13896 from fdumontet6WIND/aspath_mgm_fix
Donald Sharp [Fri, 30 Jun 2023 19:31:15 +0000 (15:31 -0400)]
Merge pull request #13896 from fdumontet6WIND/aspath_mgm_fix

bgpd: fix no set as_path replace command

22 months agobgpd: fix no set as_path replace command
Francois Dumontet [Fri, 30 Jun 2023 16:16:33 +0000 (18:16 +0200)]
bgpd: fix no set as_path replace command

fix to avoid "Excessive docstring" message

sharpd@eva ~/frr (tests_need_to_be_stricter)> sudo /usr/lib/frr/bgpd
--log stdout --log-level debug --daemon
2023/06/30 09:47:25 BGP: [K2CCG-5Y7ZJ] Excessive docstring while
parsing 'no set as-path replace [<any|ASNUM>]
[<ASNUM>$configured_asn]'
2023/06/30 09:47:25.361807 BGP: [K2CCG-5Y7ZJ] Excessive docstring
while parsing 'no set as-path replace [<any|ASNUM>]
[<ASNUM>$configured_asn]'
2023/06/30 09:47:25 BGP: [W7ENN-K2SVA] ----------
2023/06/30 09:47:25.361839 BGP: [W7ENN-K2SVA] ----------
2023/06/30 09:47:25 BGP: [WCW75-6TZPF] Define the configured AS number
2023/06/30 09:47:25.361842 BGP: [WCW75-6TZPF] Define the configured AS
number
2023/06/30 09:47:25 BGP: [W7ENN-K2SVA] ----------
2023/06/30 09:47:25.361844 BGP: [W7ENN-K2SVA] ----------
2023/06/30 09:47:25.382835 BGP: [T83RR-8SM5G] bgpd 9.1-dev starting:
vty@2605, bgp@<all>:179

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
22 months agoMerge pull request #13836 from pguibert6WIND/set_aspath_replace_with_configured_asn
Donatas Abraitis [Fri, 30 Jun 2023 09:39:55 +0000 (12:39 +0300)]
Merge pull request #13836 from pguibert6WIND/set_aspath_replace_with_configured_asn

bgpd: add 'set as-path replace' with a configured ASN

22 months agoMerge pull request #13866 from LabNConsulting/mgmtd/incllang
Jafar Al-Gharaibeh [Thu, 29 Jun 2023 22:14:21 +0000 (17:14 -0500)]
Merge pull request #13866 from LabNConsulting/mgmtd/incllang

Changes for inclusive language and other cleanup

22 months agoMerge pull request #13879 from donaldsharp/fix_check_ping_again
Donatas Abraitis [Thu, 29 Jun 2023 19:57:26 +0000 (22:57 +0300)]
Merge pull request #13879 from donaldsharp/fix_check_ping_again

tests: Fix broken check_ping run_and_expect semantics

22 months agoMerge pull request #13869 from anlancs/fix/pbr-crash-ip-protocol
Donatas Abraitis [Thu, 29 Jun 2023 19:21:55 +0000 (22:21 +0300)]
Merge pull request #13869 from anlancs/fix/pbr-crash-ip-protocol

pbrd: fix crash with match command

22 months agoMerge pull request #13877 from rwgbsd/master
Donatas Abraitis [Thu, 29 Jun 2023 14:54:14 +0000 (17:54 +0300)]
Merge pull request #13877 from rwgbsd/master

doc: Add Ubuntu 22.04 to list of builds

22 months agotests: Fix broken check_ping run_and_expect semantics
Donald Sharp [Thu, 29 Jun 2023 14:42:11 +0000 (10:42 -0400)]
tests: Fix broken check_ping run_and_expect semantics

*again*.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
22 months agodoc: Add Ubuntu 22.04 to list of builds
Rodney W. Grimes [Thu, 29 Jun 2023 07:58:30 +0000 (07:58 +0000)]
doc: Add Ubuntu 22.04 to list of builds

Add Ubuntu 22.04 build instructions to list.
Sort list into alphabetic order.

Signed-off-by: Rodney W. Grimes <rgrimes@FreeBSD.org>
22 months agoMerge pull request #13864 from pguibert6WIND/bgp_coverity_fix
Donatas Abraitis [Thu, 29 Jun 2023 08:32:15 +0000 (11:32 +0300)]
Merge pull request #13864 from pguibert6WIND/bgp_coverity_fix

Bgp coverity fix

22 months agobgpd: add 'set as-path replace' with a configured ASN
Philippe Guibert [Mon, 19 Jun 2023 14:22:55 +0000 (16:22 +0200)]
bgpd: add 'set as-path replace' with a configured ASN

There is no route-map set action to replace any ASN,
or a part of an ASN, with a configured ASN.

The current commit adds a new command to use a configured
ASN as replacement, instead of using the local as number.

> set as-path replace any 65500

Update the 'bgp_set_aspath_replace' test.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
22 months agobgpd: fix covery 1566055, label table overrun
Philippe Guibert [Tue, 27 Jun 2023 16:21:53 +0000 (18:21 +0200)]
bgpd: fix covery 1566055, label table overrun

In case the full label stack is used, there may be
a table overrun happening. Avoid it by increasing the
size of the table.

Fixes: 27f4deed0ac1 ("bgpd: update the mpls entry to handle return traffic")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
22 months agobgpd: fix covery scan 1566054 with null pointer
Philippe Guibert [Tue, 27 Jun 2023 16:12:39 +0000 (18:12 +0200)]
bgpd: fix covery scan 1566054 with null pointer

The bmnc pointer is never null. Do not keep the test
on the pointer.

Fixes: 1069425868d1 ("bgpd: allocate label bound to received mpls vpn routes")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
22 months agopbrd: fix crash with match command
anlan_cs [Wed, 28 Jun 2023 04:31:52 +0000 (12:31 +0800)]
pbrd: fix crash with match command

Crash with empty `ip-protocol`:
```
anlan(config-pbr-map)# match ip-protocol
vtysh: error reading from pbrd: Resource temporarily unavailable (11)Warning: closing connection to pbrd because of an I/O error!
```

So, give warning for empty `ip-protocol`.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
22 months agoMerge pull request #13870 from iqras23/bm_terminate
Donatas Abraitis [Wed, 28 Jun 2023 12:20:07 +0000 (15:20 +0300)]
Merge pull request #13870 from iqras23/bm_terminate

bgpd: Ensure peer data structure is accessed only when BGPD is not te…

22 months agoMerge pull request #13861 from opensourcerouting/fix/memory_leak_zserv
Mark Stapp [Wed, 28 Jun 2023 12:18:11 +0000 (08:18 -0400)]
Merge pull request #13861 from opensourcerouting/fix/memory_leak_zserv

zebra: Free Zebra client resources

22 months agoMerge pull request #13850 from Keelan10/pimd-leak-fix
mobash-rasool [Wed, 28 Jun 2023 10:42:10 +0000 (16:12 +0530)]
Merge pull request #13850 from Keelan10/pimd-leak-fix

pimd: Fix memory leak in PIM interface deletion

22 months agobgpd: Ensure peer data structure is accessed only when BGPD is not terminating
Naveen Thanikachalam [Mon, 4 Feb 2019 14:26:01 +0000 (06:26 -0800)]
bgpd: Ensure peer data structure is accessed only when BGPD is not terminating

With these changes,
the code ensures that the peer data-structures are accessed
only after it knows that BGPD is not terminating.

Authored-by: Naveen Thanikachalam <nthanikachal@vmware.com>
Signed-off-by: Iqra Siddiqui <imujeebsiddi@vmware.com>
22 months agoMerge pull request #13867 from mjstapp/fix_opq_source
Donatas Abraitis [Wed, 28 Jun 2023 06:04:05 +0000 (09:04 +0300)]
Merge pull request #13867 from mjstapp/fix_opq_source

isisd, ospfd: fix opaque zapi source parsing

22 months agomgmtd: convert map to darr use allowing dynamic registrations
Christian Hopps [Sat, 24 Jun 2023 16:35:47 +0000 (12:35 -0400)]
mgmtd: convert map to darr use allowing dynamic registrations

- move from the static allocated and initialize xpath map to using the
new darr (dynamic array) code.

Signed-off-by: Christian Hopps <chopps@labn.net>
22 months agolib: add dynamic array type
Christian Hopps [Fri, 23 Jun 2023 18:34:47 +0000 (14:34 -0400)]
lib: add dynamic array type

Signed-off-by: Christian Hopps <chopps@labn.net>
22 months agomgmtd: remove unused "placeholder" code.
Christian Hopps [Tue, 27 Jun 2023 18:12:39 +0000 (14:12 -0400)]
mgmtd: remove unused "placeholder" code.

We don't need un-run/un-tested placeholder code we may never need.

Signed-off-by: Christian Hopps <chopps@labn.net>
22 months agomgmtd: consolidate getcfg and getdata msgs into "get"
Christian Hopps [Tue, 27 Jun 2023 17:58:54 +0000 (13:58 -0400)]
mgmtd: consolidate getcfg and getdata msgs into "get"

eliminates tons of copy and paste code.

Signed-off-by: Christian Hopps <chopps@labn.net>
22 months agoisisd, ospfd: fix opaque zapi source parsing
Mark Stapp [Tue, 27 Jun 2023 20:32:54 +0000 (16:32 -0400)]
isisd, ospfd: fix opaque zapi source parsing

Opaque zapi messages carry the sender's zclient tuple now,
daemons shouldn't try to parse those bits directly.

Signed-off-by: Mark Stapp <mjs@labn.net>
22 months agozebra: Free Zebra client resources
Donatas Abraitis [Tue, 27 Jun 2023 08:44:10 +0000 (11:44 +0300)]
zebra: Free Zebra client resources

Memory leaks started flowing:

```
AddressSanitizer Topotests Part 0:  15 KB -> 283 KB
AddressSanitizer Topotests Part 1:  1 KB -> 495 KB
AddressSanitizer Topotests Part 2:  13 KB -> 478 KB
AddressSanitizer Topotests Part 3:  39 KB -> 213 KB
AddressSanitizer Topotests Part 4:  30 KB -> 836 KB
AddressSanitizer Topotests Part 5:  0 bytes -> 356 KB
AddressSanitizer Topotests Part 6:  86 KB -> 783 KB
AddressSanitizer Topotests Part 7:  0 bytes -> 354 KB
AddressSanitizer Topotests Part 8:  0 bytes -> 62 KB
AddressSanitizer Topotests Part 9:  408 KB -> 518 KB
```

```
Direct leak of 3584 byte(s) in 1 object(s) allocated from:
    #0 0x7f1957b02d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x559895c55df0 in qcalloc lib/memory.c:105
    #2 0x559895bc1cdf in zserv_client_create zebra/zserv.c:743
    #3 0x559895bc1cdf in zserv_accept zebra/zserv.c:880
    #4 0x559895cf3438 in event_call lib/event.c:1995
    #5 0x559895c3901c in frr_run lib/libfrr.c:1213
    #6 0x559895a698f1 in main zebra/main.c:472
    #7 0x7f195635ec86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
```

Fixes b20acd0 ("bgpd: Use synchronous way to get labels from Zebra")

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agomgmtd: inclusive language change
Christian Hopps [Mon, 26 Jun 2023 16:59:59 +0000 (12:59 -0400)]
mgmtd: inclusive language change

'cfg_btch' -> 'batch' and 'btch_list' -> 'batch_list'

Signed-off-by: Christian Hopps <chopps@labn.net>
22 months agoMerge pull request #13838 from ak503/static_bfd_vrf
Christian Hopps [Tue, 27 Jun 2023 15:34:50 +0000 (11:34 -0400)]
Merge pull request #13838 from ak503/static_bfd_vrf

staticd: Fix bfd for static route in VRF

22 months agoMerge pull request #13826 from opensourcerouting/fix/ripng_match_ipv6_acls
Russ White [Tue, 27 Jun 2023 15:31:23 +0000 (11:31 -0400)]
Merge pull request #13826 from opensourcerouting/fix/ripng_match_ipv6_acls

ripng: match ipv6 address [prefix-list] CMDs

22 months agoMerge pull request #13852 from mjstapp/fix_opq_cov_msg
Russ White [Tue, 27 Jun 2023 15:28:31 +0000 (11:28 -0400)]
Merge pull request #13852 from mjstapp/fix_opq_cov_msg

zebra: clean up coverity warning in opaque api

22 months agoMerge pull request #13859 from opensourcerouting/fix/bgpd_coverity_issues
Russ White [Tue, 27 Jun 2023 14:26:02 +0000 (10:26 -0400)]
Merge pull request #13859 from opensourcerouting/fix/bgpd_coverity_issues

bgpd: Check for NULL before assigning a peer from the group

22 months agoMerge pull request #13854 from chiragshah6/fdev2
Russ White [Tue, 27 Jun 2023 14:25:39 +0000 (10:25 -0400)]
Merge pull request #13854 from chiragshah6/fdev2

zebra: fix evpn rmac nh list cmp function

22 months agoMerge pull request #13851 from opensourcerouting/fix/use_zclient_sync_for_table_manager
Mark Stapp [Tue, 27 Jun 2023 12:54:46 +0000 (08:54 -0400)]
Merge pull request #13851 from opensourcerouting/fix/use_zclient_sync_for_table_manager

bgpd: Use synchronous Zebra client for table manager

22 months agoMerge pull request #13628 from kuldeepkash/uplink_mcast_tests
Donatas Abraitis [Tue, 27 Jun 2023 10:34:17 +0000 (13:34 +0300)]
Merge pull request #13628 from kuldeepkash/uplink_mcast_tests

tests: Add multicast-pim-multi-uplink test suite

22 months agoMerge pull request #13672 from zmw12306/AE_zero
Donatas Abraitis [Tue, 27 Jun 2023 10:18:20 +0000 (13:18 +0300)]
Merge pull request #13672 from zmw12306/AE_zero

babeld: add AE!=0 check when type is 7 or 10.

22 months agoMerge pull request #13722 from fdumontet6WIND/color_extcomm
Donatas Abraitis [Tue, 27 Jun 2023 10:03:22 +0000 (13:03 +0300)]
Merge pull request #13722 from fdumontet6WIND/color_extcomm

bgpd,lib,yang: add colored extended communities support

22 months agoMerge pull request #13857 from anlancs/doc-wrong-code
Donatas Abraitis [Tue, 27 Jun 2023 09:56:47 +0000 (12:56 +0300)]
Merge pull request #13857 from anlancs/doc-wrong-code

doc: Fix one syntax error for code block

22 months agobgpd: Check for NULL before assigning a peer from the group
Donatas Abraitis [Tue, 27 Jun 2023 06:50:02 +0000 (09:50 +0300)]
bgpd: Check for NULL before assigning a peer from the group

CID 1566056

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agobgpd: Guard zlog_debug for table manager when the connection is successful
Donatas Abraitis [Tue, 27 Jun 2023 06:32:07 +0000 (09:32 +0300)]
bgpd: Guard zlog_debug for table manager when the connection is successful

We shouldn't use unguarded zlog_debug().

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agobgpd: Use zlog_err when can't connect to table manager (zebra)
Donatas Abraitis [Tue, 27 Jun 2023 06:29:52 +0000 (09:29 +0300)]
bgpd: Use zlog_err when can't connect to table manager (zebra)

If this an error, we should use zlog_err, not zlog_info as this is literally
not an information, but an error.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agodoc: Fix one syntax error for code block
anlan_cs [Tue, 27 Jun 2023 05:19:28 +0000 (13:19 +0800)]
doc: Fix one syntax error for code block

The code block doesn't work due to special thing in front of it.
So, just make it work.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
22 months agopimd: Fix memory leak in PIM interface deletion
Keelan10 [Mon, 26 Jun 2023 10:56:26 +0000 (14:56 +0400)]
pimd: Fix memory leak in PIM interface deletion

This commit ensures proper cleanup by deleting the gm_join_list when a PIM interface is deleted. The gm_join_list was previously not being freed, causing a memory leak.

The ASan leak log for reference:
```
***********************************************************************************
Address Sanitizer Error detected in multicast_mld_join_topo1.test_multicast_mld_local_join/r1.asan.pim6d.28070

=================================================================
==28070==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 40 byte(s) in 1 object(s) allocated from:
    #0 0x7f3605dbfd28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x56230373dd6b in qcalloc lib/memory.c:105
    #2 0x56230372180f in list_new lib/linklist.c:49
    #3 0x56230361b589 in pim_if_gm_join_add pimd/pim_iface.c:1313
    #4 0x562303642247 in lib_interface_gmp_address_family_static_group_create pimd/pim_nb_config.c:2868
    #5 0x562303767280 in nb_callback_create lib/northbound.c:1235
    #6 0x562303767280 in nb_callback_configuration lib/northbound.c:1579
    #7 0x562303768a1d in nb_transaction_process lib/northbound.c:1710
    #8 0x56230376904a in nb_candidate_commit_apply lib/northbound.c:1104
    #9 0x5623037692ba in nb_candidate_commit lib/northbound.c:1137
    #10 0x562303769dec in nb_cli_classic_commit lib/northbound_cli.c:49
    #11 0x56230376fb79 in nb_cli_pending_commit_check lib/northbound_cli.c:88
    #12 0x5623036c5bcb in cmd_execute_command_real lib/command.c:991
    #13 0x5623036c5f1b in cmd_execute_command lib/command.c:1053
    #14 0x5623036c6392 in cmd_execute lib/command.c:1221
    #15 0x5623037e75da in vty_command lib/vty.c:591
    #16 0x5623037e7a74 in vty_execute lib/vty.c:1354
    #17 0x5623037f0253 in vtysh_read lib/vty.c:2362
    #18 0x5623037db4e8 in event_call lib/event.c:1995
    #19 0x562303720f97 in frr_run lib/libfrr.c:1213
    #20 0x56230368615d in main pimd/pim6_main.c:184
    #21 0x7f360461bc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 192 byte(s) in 4 object(s) allocated from:
    #0 0x7f3605dbfd28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x56230373dd6b in qcalloc lib/memory.c:105
    #2 0x56230361b91d in gm_join_new pimd/pim_iface.c:1288
    #3 0x56230361b91d in pim_if_gm_join_add pimd/pim_iface.c:1326
    #4 0x562303642247 in lib_interface_gmp_address_family_static_group_create pimd/pim_nb_config.c:2868
    #5 0x562303767280 in nb_callback_create lib/northbound.c:1235
    #6 0x562303767280 in nb_callback_configuration lib/northbound.c:1579
    #7 0x562303768a1d in nb_transaction_process lib/northbound.c:1710
    #8 0x56230376904a in nb_candidate_commit_apply lib/northbound.c:1104
    #9 0x5623037692ba in nb_candidate_commit lib/northbound.c:1137
    #10 0x562303769dec in nb_cli_classic_commit lib/northbound_cli.c:49
    #11 0x56230376fb79 in nb_cli_pending_commit_check lib/northbound_cli.c:88
    #12 0x5623036c5bcb in cmd_execute_command_real lib/command.c:991
    #13 0x5623036c5f1b in cmd_execute_command lib/command.c:1053
    #14 0x5623036c6392 in cmd_execute lib/command.c:1221
    #15 0x5623037e75da in vty_command lib/vty.c:591
    #16 0x5623037e7a74 in vty_execute lib/vty.c:1354
    #17 0x5623037f0253 in vtysh_read lib/vty.c:2362
    #18 0x5623037db4e8 in event_call lib/event.c:1995
    #19 0x562303720f97 in frr_run lib/libfrr.c:1213
    #20 0x56230368615d in main pimd/pim6_main.c:184
    #21 0x7f360461bc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 96 byte(s) in 4 object(s) allocated from:
    #0 0x7f3605dbfd28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x56230373dd6b in qcalloc lib/memory.c:105
    #2 0x562303721651 in listnode_new lib/linklist.c:71
    #3 0x56230372182b in listnode_add lib/linklist.c:92
    #4 0x56230361ba9a in gm_join_new pimd/pim_iface.c:1295
    #5 0x56230361ba9a in pim_if_gm_join_add pimd/pim_iface.c:1326
    #6 0x562303642247 in lib_interface_gmp_address_family_static_group_create pimd/pim_nb_config.c:2868
    #7 0x562303767280 in nb_callback_create lib/northbound.c:1235
    #8 0x562303767280 in nb_callback_configuration lib/northbound.c:1579
    #9 0x562303768a1d in nb_transaction_process lib/northbound.c:1710
    #10 0x56230376904a in nb_candidate_commit_apply lib/northbound.c:1104
    #11 0x5623037692ba in nb_candidate_commit lib/northbound.c:1137
    #12 0x562303769dec in nb_cli_classic_commit lib/northbound_cli.c:49
    #13 0x56230376fb79 in nb_cli_pending_commit_check lib/northbound_cli.c:88
    #14 0x5623036c5bcb in cmd_execute_command_real lib/command.c:991
    #15 0x5623036c5f1b in cmd_execute_command lib/command.c:1053
    #16 0x5623036c6392 in cmd_execute lib/command.c:1221
    #17 0x5623037e75da in vty_command lib/vty.c:591
    #18 0x5623037e7a74 in vty_execute lib/vty.c:1354
    #19 0x5623037f0253 in vtysh_read lib/vty.c:2362
    #20 0x5623037db4e8 in event_call lib/event.c:1995
    #21 0x562303720f97 in frr_run lib/libfrr.c:1213
    #22 0x56230368615d in main pimd/pim6_main.c:184
    #23 0x7f360461bc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 48 byte(s) in 1 object(s) allocated from:
    #0 0x7f3605dbfd28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x56230373dd6b in qcalloc lib/memory.c:105
    #2 0x56230361b91d in gm_join_new pimd/pim_iface.c:1288
    #3 0x56230361b91d in pim_if_gm_join_add pimd/pim_iface.c:1326
    #4 0x562303642247 in lib_interface_gmp_address_family_static_group_create pimd/pim_nb_config.c:2868
    #5 0x562303767280 in nb_callback_create lib/northbound.c:1235
    #6 0x562303767280 in nb_callback_configuration lib/northbound.c:1579
    #7 0x562303768a1d in nb_transaction_process lib/northbound.c:1710
    #8 0x56230376904a in nb_candidate_commit_apply lib/northbound.c:1104
    #9 0x5623037692ba in nb_candidate_commit lib/northbound.c:1137
    #10 0x562303769dec in nb_cli_classic_commit lib/northbound_cli.c:49
    #11 0x56230376fb79 in nb_cli_pending_commit_check lib/northbound_cli.c:88
    #12 0x5623036c5bcb in cmd_execute_command_real lib/command.c:991
    #13 0x5623036c5f6f in cmd_execute_command lib/command.c:1072
    #14 0x5623036c6392 in cmd_execute lib/command.c:1221
    #15 0x5623037e75da in vty_command lib/vty.c:591
    #16 0x5623037e7a74 in vty_execute lib/vty.c:1354
    #17 0x5623037f0253 in vtysh_read lib/vty.c:2362
    #18 0x5623037db4e8 in event_call lib/event.c:1995
    #19 0x562303720f97 in frr_run lib/libfrr.c:1213
    #20 0x56230368615d in main pimd/pim6_main.c:184
    #21 0x7f360461bc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x7f3605dbfd28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x56230373dd6b in qcalloc lib/memory.c:105
    #2 0x562303721651 in listnode_new lib/linklist.c:71
    #3 0x56230372182b in listnode_add lib/linklist.c:92
    #4 0x56230361ba9a in gm_join_new pimd/pim_iface.c:1295
    #5 0x56230361ba9a in pim_if_gm_join_add pimd/pim_iface.c:1326
    #6 0x562303642247 in lib_interface_gmp_address_family_static_group_create pimd/pim_nb_config.c:2868
    #7 0x562303767280 in nb_callback_create lib/northbound.c:1235
    #8 0x562303767280 in nb_callback_configuration lib/northbound.c:1579
    #9 0x562303768a1d in nb_transaction_process lib/northbound.c:1710
    #10 0x56230376904a in nb_candidate_commit_apply lib/northbound.c:1104
    #11 0x5623037692ba in nb_candidate_commit lib/northbound.c:1137
    #12 0x562303769dec in nb_cli_classic_commit lib/northbound_cli.c:49
    #13 0x56230376fb79 in nb_cli_pending_commit_check lib/northbound_cli.c:88
    #14 0x5623036c5bcb in cmd_execute_command_real lib/command.c:991
    #15 0x5623036c5f6f in cmd_execute_command lib/command.c:1072
    #16 0x5623036c6392 in cmd_execute lib/command.c:1221
    #17 0x5623037e75da in vty_command lib/vty.c:591
    #18 0x5623037e7a74 in vty_execute lib/vty.c:1354
    #19 0x5623037f0253 in vtysh_read lib/vty.c:2362
    #20 0x5623037db4e8 in event_call lib/event.c:1995
    #21 0x562303720f97 in frr_run lib/libfrr.c:1213
    #22 0x56230368615d in main pimd/pim6_main.c:184
    #23 0x7f360461bc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

SUMMARY: AddressSanitizer: 400 byte(s) leaked in 11 allocation(s).
***********************************************************************************
```

Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
22 months agozebra: fix evpn rmac nh list cmp function
Chirag Shah [Mon, 26 Jun 2023 22:29:59 +0000 (15:29 -0700)]
zebra: fix evpn rmac nh list cmp function

EVPN RMAC (Router MAC) nexthop list compare
function needs to return all values so
the list element can be compared and added/deleted
properly.

Ticket:#3486989
Testing Done:
Originate EVPN Type-5 route with PIP IP and MAC as remote
nexthops.
Change the PIP IP address which triggers nexthop change.

Before fix:
When PIP IP changes RMAC is deleted from remote VTEPs.

TORS1# show evpn next-hops vni 4001 | include 00:02:00:00:00:2d
27.0.0.11       00:02:00:00:00:2d
TORS1# show evpn rmac vni 4001 | include 00:02:00:00:00:2d
00:02:00:00:00:2d 27.0.0.11

----- Remote VTEP change nexthop IP to 172.16.16.16 -----

TORS1# show evpn next-hops vni 4001 | include 00:02:00:00:00:2d
172.16.16.16    00:02:00:00:00:2d
TORS1# show evpn rmac vni 4001 | include 00:02:00:00:00:2d
TORS1#

After fix:
RMAC is retained as its nexthop list is not empty,
thus it is not deleted from remote VTEPs.

TORS1# show evpn rmac vni 4001 | include 00:02:00:00:00:2d
00:02:00:00:00:2d 172.16.16.16

Log:
2023/06/27 00:50:36.833474 ZEBRA: [XREH0-ZYMH6] L3VNI 4001 Remote VTEP
change(27.0.0.11 -> 172.16.16.16) for RMAC 00:02:00:00:00:2d

Signed-off-by: Chirag Shah <chirag@nvidia.com>
22 months agoMerge pull request #13804 from LabNConsulting/aceelindem/ospf6d-config-callbacks
Donald Sharp [Mon, 26 Jun 2023 18:59:13 +0000 (14:59 -0400)]
Merge pull request #13804 from LabNConsulting/aceelindem/ospf6d-config-callbacks

ospf6d: Add config callbacks to suppress hellos during config load.

22 months agoMerge pull request #13802 from LabNConsulting/aceelindem/ospfd-config-callbacks
Donald Sharp [Mon, 26 Jun 2023 18:58:03 +0000 (14:58 -0400)]
Merge pull request #13802 from LabNConsulting/aceelindem/ospfd-config-callbacks

ospfd: Add config callbacks and suppress hello during config load.

22 months agozebra: clean up coverity warning in opaque api
Mark Stapp [Mon, 26 Jun 2023 17:19:23 +0000 (13:19 -0400)]
zebra: clean up coverity warning in opaque api

Seems a bit fussy of coverity, but ... don't NULL a variable
unnecessarily.

Signed-off-by: Mark Stapp <mjs@labn.net>
22 months agobgpd: Use synchronous Zebra client for table manager
Donatas Abraitis [Wed, 21 Jun 2023 21:20:53 +0000 (00:20 +0300)]
bgpd: Use synchronous Zebra client for table manager

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agodoc: extcommunity color
Francois Dumontet [Sat, 10 Jun 2023 16:27:35 +0000 (18:27 +0200)]
doc: extcommunity color

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
22 months agobgpd: add functions related to srte_color management
Francois Dumontet [Fri, 9 Jun 2023 12:30:33 +0000 (14:30 +0200)]
bgpd: add functions related to srte_color management

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
22 months agotests: add bgp colored extended community test
Francois Dumontet [Thu, 25 May 2023 16:23:48 +0000 (18:23 +0200)]
tests: add bgp colored extended community test

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
22 months agobgpd: add colored extended communities support
Francois Dumontet [Mon, 22 May 2023 13:36:06 +0000 (15:36 +0200)]
bgpd: add colored extended communities support

add support of color extended community, conforming to RFC 9012.
This extended community will be added to the existing one, RT,SOO
and Node Target. The configuration will be made through the
route-map service.

find above a configuration example:

router bgp 65001
 bgp router-id 192.168.1.1
 no bgp ebgp-requires-policy
 no bgp network import-check
 neighbor 192.168.1.2 remote-as external
 neighbor 192.168.1.3 remote-as external
 neighbor 192.168.1.4 remote-as external
 address-family ipv4 unicast
  network 10.10.10.10/24 route-map rmap
  exit-address-family
!
  route-map rmap permit 10
   set extcommunity color 55555 200
  exit

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
22 months agoMerge pull request #13771 from mjstapp/opaque_notify
Donatas Abraitis [Mon, 26 Jun 2023 10:08:52 +0000 (13:08 +0300)]
Merge pull request #13771 from mjstapp/opaque_notify

lib, zebra, sharpd: add notifications for ZAPI opaque message registration events

22 months agoMerge pull request #13848 from LabNConsulting/chopps/clang-format-tweak
Donatas Abraitis [Mon, 26 Jun 2023 09:55:10 +0000 (12:55 +0300)]
Merge pull request #13848 from LabNConsulting/chopps/clang-format-tweak

tools: less aggressive settings for clang-format

22 months agoMerge pull request #13839 from LabNConsulting/chopps/nofiltermodule
Jafar Al-Gharaibeh [Mon, 26 Jun 2023 04:54:57 +0000 (23:54 -0500)]
Merge pull request #13839 from LabNConsulting/chopps/nofiltermodule

staticd: remove unused YANG module

22 months agotests: Add multicast-pim-multi-uplink-topo3 suite
Kuldeep Kashyap [Tue, 30 May 2023 06:03:51 +0000 (11:33 +0530)]
tests: Add multicast-pim-multi-uplink-topo3 suite

Added 4 new test cases to verify multicast PIM
uplink(8 uplink) functionality.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
22 months agotests: Add multicast-pim-multi-uplink-topo2 suite
Kuldeep Kashyap [Tue, 30 May 2023 06:00:43 +0000 (11:30 +0530)]
tests: Add multicast-pim-multi-uplink-topo2 suite

Added 4 new test cases to verify multicast PIM
uplink(8 uplink) functionality.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
22 months agotools: less aggressive settings for clang-format
Christian Hopps [Sun, 25 Jun 2023 12:13:25 +0000 (08:13 -0400)]
tools: less aggressive settings for clang-format

- Reports were that the current settings were choosing to extend beyond 80
columns too often. This change makes that more expensive but still tries
very hard to not break before first open parenthesis of function calls.

Signed-off-by: Christian Hopps <chopps@labn.net>
22 months agoMerge pull request #13845 from LabNConsulting/aceelindem/isis-config-end-error-log
Donatas Abraitis [Sat, 24 Jun 2023 20:35:58 +0000 (23:35 +0300)]
Merge pull request #13845 from LabNConsulting/aceelindem/isis-config-end-error-log

isisd: Log error when config-end timeout occurs.

22 months agoMerge pull request #13844 from LabNConsulting/aceelindem/bgp-config-callback-log
Donatas Abraitis [Sat, 24 Jun 2023 20:22:56 +0000 (23:22 +0300)]
Merge pull request #13844 from LabNConsulting/aceelindem/bgp-config-callback-log

bgpd: Add config-end timeout error log message.

22 months agoMerge pull request #13822 from SaiGomathiN/regF
Donatas Abraitis [Sat, 24 Jun 2023 20:22:10 +0000 (23:22 +0300)]
Merge pull request #13822 from SaiGomathiN/regF

pim, pim6d: pimreg interface is not getting added in a certain scenario

22 months agoisisd: Log error when config-end timeout occurs.
Acee [Sat, 24 Jun 2023 17:43:03 +0000 (13:43 -0400)]
isisd: Log error when config-end timeout occurs.

Signed-off-by: Acee <aceelindem@gmail.com>
22 months agobgpd: Add config-end timemout error log message.
Acee [Sat, 24 Jun 2023 17:29:24 +0000 (13:29 -0400)]
bgpd: Add config-end timemout error log message.

Signed-off-by: Acee <aceelindem@gmail.com>
22 months agostaticd: remove unused YANG module
Christian Hopps [Fri, 23 Jun 2023 17:16:18 +0000 (13:16 -0400)]
staticd: remove unused YANG module

Signed-off-by: Christian Hopps <chopps@labn.net>
22 months agostaticd: Fix bfd for static route in VRF
Dmitrii Turlupov [Fri, 23 Jun 2023 15:48:59 +0000 (18:48 +0300)]
staticd: Fix bfd for static route in VRF

vrf BELLA
 ip route 1.1.1.1/32 192.168.1.1 bfd profile test
exit-vrf

Before patch:
# do show bfd peers
BFD Peers:
peer 192.168.1.1 vrf default

After patch:
# do show bfd peers
BFD Peers:
peer 192.168.1.1 vrf BELLA

Signed-off-by: Dmitrii Turlupov <turlupov@zts.ru>
22 months agosharpd: support opaque zapi notifications
Mark Stapp [Mon, 12 Jun 2023 20:14:45 +0000 (16:14 -0400)]
sharpd: support opaque zapi notifications

Add cli and support to sharpd to exercise the zapi opaque
'notification' features.

Signed-off-by: Mark Stapp <mjs@labn.net>
22 months agozebra: support notifications for opaque ZAPI messages
Mark Stapp [Wed, 31 May 2023 20:25:15 +0000 (16:25 -0400)]
zebra: support notifications for opaque ZAPI messages

Allow zapi clients to register to be notified when a server
for an  opaque message type is present. Zebra maintains these
notification registrations in the same data structures that it
uses for opaque message handling.

Signed-off-by: Mark Stapp <mjs@labn.net>
22 months agolib: add notifications for opaque zapi messages
Mark Stapp [Wed, 31 May 2023 20:22:16 +0000 (16:22 -0400)]
lib: add notifications for opaque zapi messages

Add a new notification zapi message type. A zapi client
that uses opaque messages can register to be notified
when a server for an opaque type is present.

Signed-off-by: Mark Stapp <mjs@labn.net>
22 months agolib, zebra: include source client zapi info in opaque messages
Mark Stapp [Mon, 29 May 2023 17:04:24 +0000 (13:04 -0400)]
lib, zebra: include source client zapi info in opaque messages

Include the sending zapi client info (proto, instance, and
session id) in each opaque zapi message. Add opaque 'init'
apis for clients who want to encode their opaque data inline,
into the zclient's internal stream buffer. Use these init apis
in the TE/link-state lib code, instead of hand-coding the
zapi opaque header info.

Signed-off-by: Mark Stapp <mjs@labn.net>
22 months agoospf6d: Add config callbacks to suppress hellos during config load. Add bgpd/isisd...
Acee [Sun, 18 Jun 2023 11:22:45 +0000 (07:22 -0400)]
ospf6d: Add config callbacks to suppress hellos during config load. Add bgpd/isisd message.

Signed-off-by: Acee <aceelindem@gmail.com>
22 months agoospfd: Add config callbacks and suppress hello during config load.
Acee [Thu, 15 Jun 2023 21:50:24 +0000 (17:50 -0400)]
ospfd: Add config callbacks and suppress hello during config load.

Signed-off-by: Acee <aceelindem@gmail.com>
22 months agoMerge pull request #13545 from idryzhov/remove-bond-slave
Donatas Abraitis [Fri, 23 Jun 2023 08:01:19 +0000 (11:01 +0300)]
Merge pull request #13545 from idryzhov/remove-bond-slave

zebra: remove ZEBRA_IF_BOND_SLAVE interface type

22 months agoMerge pull request #13823 from LabNConsulting/aceelindem/workflow-coverity-typo
Jafar Al-Gharaibeh [Thu, 22 Jun 2023 18:32:09 +0000 (13:32 -0500)]
Merge pull request #13823 from LabNConsulting/aceelindem/workflow-coverity-typo

doc: Fix typo in previous Coverity workflow doc commit.

22 months agoMerge pull request #13795 from LabNConsulting/chopps/mgmt-lock-cleanup
Jafar Al-Gharaibeh [Thu, 22 Jun 2023 18:31:27 +0000 (13:31 -0500)]
Merge pull request #13795 from LabNConsulting/chopps/mgmt-lock-cleanup

mgmt lock simplification

22 months agoMerge pull request #13824 from LabNConsulting/chopps/update-clang-format
Donatas Abraitis [Thu, 22 Jun 2023 11:07:23 +0000 (14:07 +0300)]
Merge pull request #13824 from LabNConsulting/chopps/update-clang-format

tools: import latest linux clang-format config w/ FRR mods

22 months agotools: import latest linux clang-format config w/ FRR mods
Christian Hopps [Wed, 21 Jun 2023 13:32:39 +0000 (09:32 -0400)]
tools: import latest linux clang-format config w/ FRR mods

We modify the following from Linux Style:

    AlignEscapedNewlines: Left -> Right
    AlignTrailingComments: false -> true
    AlignConsecutiveMacros: false -> true
    ForEachMacros (replace linux with ours)

Don't break a string into multi-string-fragments

    PenaltyBreakString: 200

Allow going past the ColumnLimit to keep function arguments aligned
with the open parenthesis.

    PenaltyBreakBeforeFirstCallParameter: 200

Signed-off-by: Christian Hopps <chopps@labn.net>
22 months agotests: Check if `match ipv6 address [prefix-list]` CMDs work for ripng
Donatas Abraitis [Wed, 21 Jun 2023 20:50:42 +0000 (23:50 +0300)]
tests: Check if `match ipv6 address [prefix-list]` CMDs work for ripng

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agodoc: Add documentation for route-maps for ripng
Donatas Abraitis [Wed, 21 Jun 2023 20:47:45 +0000 (23:47 +0300)]
doc: Add documentation for route-maps for ripng

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agoMerge pull request #13825 from sri-mohan1/srib-ripng
Mark Stapp [Wed, 21 Jun 2023 20:27:01 +0000 (16:27 -0400)]
Merge pull request #13825 from sri-mohan1/srib-ripng

ripngd: changes for code maintainability

22 months agoripngd: add ability to match by ipv6 access/prefix list in route-maps
Igor Ryzhov [Tue, 27 Jul 2021 17:48:47 +0000 (20:48 +0300)]
ripngd: add ability to match by ipv6 access/prefix list in route-maps

Closes #8141.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
22 months agoMerge pull request #13731 from cyberstorm-mauritius/cid1519841
mobash-rasool [Wed, 21 Jun 2023 17:45:41 +0000 (23:15 +0530)]
Merge pull request #13731 from cyberstorm-mauritius/cid1519841

vrrp: check return value for turning off multicast for v6

22 months agoripngd: changes for code maintainability
sri-mohan1 [Wed, 21 Jun 2023 16:56:43 +0000 (22:26 +0530)]
ripngd: changes for code maintainability

these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
22 months agoMerge pull request #13797 from sri-mohan1/srib-ripng
Donatas Abraitis [Wed, 21 Jun 2023 14:00:00 +0000 (17:00 +0300)]
Merge pull request #13797 from sri-mohan1/srib-ripng

ripngd: changes for code maintainability

22 months agoMerge pull request #13790 from pguibert6WIND/set_aspath_exclude
Russ White [Wed, 21 Jun 2023 12:48:21 +0000 (08:48 -0400)]
Merge pull request #13790 from pguibert6WIND/set_aspath_exclude

bgpd: add 'set as-path exclude all' command

22 months agoMerge pull request #13780 from opensourcerouting/fix/use_sync_zapi_for_labels
Mark Stapp [Wed, 21 Jun 2023 11:49:07 +0000 (07:49 -0400)]
Merge pull request #13780 from opensourcerouting/fix/use_sync_zapi_for_labels

bgpd: Use synchronous way to get labels from Zebra

22 months agodoc: Fix typo in previous Coverity workflow doc commit.
Acee Lindem [Wed, 21 Jun 2023 11:11:10 +0000 (07:11 -0400)]
doc: Fix typo in previous Coverity workflow doc commit.

Signed-off-by: Acee Lindem <aceelindem@gmail.com>
22 months agopim, pim6d: pimreg interface is not getting added in a certain scenario
Sai Gomathi N [Wed, 21 Jun 2023 09:53:09 +0000 (02:53 -0700)]
pim, pim6d: pimreg interface is not getting added in a certain scenario

Problem:
When ipv6 pim configuration is removed from the IIF on FHR node,
if we wait for RST timer to expire and then add the ipv6 pim configuration on the IIF again,
it is seen that pimreg is not getting added due to which null register wont be sent,
the register flag state also remains NO_INFO forever instead of RegPrune.
The reason for this is, when RST timer expires and IIF is unknown for the (S,G) upstream,
the FHR state is not reset due to which when the RP becomes reachable,
upstream state changes from NotJoined to Join but the register suppress timer could not be started
since we see there is no change in FHR state.

Fix:
When the Register Timer expires and the reg state is set to PIM_REG_NOINFO,reset the FHR flag,
so that when the RP becomes reachable can be because of config change or RP not reachable,
it is able to resume its duty.

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
22 months agozebra: Ignore non GR-aware zclient handling for BGP
Donatas Abraitis [Mon, 19 Jun 2023 15:35:52 +0000 (18:35 +0300)]
zebra: Ignore non GR-aware zclient handling for BGP

This is for synchronous client (label/table manager) - aka session_id == 1.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agobgpd: Do not initialize global variable zclient_sync to NULL
Donatas Abraitis [Mon, 19 Jun 2023 14:30:16 +0000 (17:30 +0300)]
bgpd: Do not initialize global variable zclient_sync to NULL

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agozebra: Show session id when printing an error when the client disconnects
Donatas Abraitis [Sun, 18 Jun 2023 19:07:54 +0000 (22:07 +0300)]
zebra: Show session id when printing an error when the client disconnects

Before:

```
2023/06/18 22:00:42 ZEBRA: [VXKFG-8SJRV][EC 4043309121] Client 'bgp' encountered an error and is shutting down.
2023/06/18 22:00:42 ZEBRA: [VXKFG-8SJRV][EC 4043309121] Client 'bgp' encountered an error and is shutting down.
```

After:

```
2023/06/18 22:06:44 ZEBRA: [N5M5Y-J5BPG][EC 4043309121] Client 'bgp' (session id 0) encountered an error and is shutting down.
2023/06/18 22:06:44 ZEBRA: [N5M5Y-J5BPG][EC 4043309121] Client 'bgp' (session id 1) encountered an error and is shutting down.
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agobgpd: Reuse bgp_zebra_label_manager_ready() helper function
Donatas Abraitis [Sat, 17 Jun 2023 06:26:52 +0000 (09:26 +0300)]
bgpd: Reuse bgp_zebra_label_manager_ready() helper function

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agobgpd: Retry connecting to synchronouse label manager if not ready
Donatas Abraitis [Sat, 17 Jun 2023 06:21:55 +0000 (09:21 +0300)]
bgpd: Retry connecting to synchronouse label manager if not ready

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agobgpd: Use synchronous way to get labels from Zebra
Donatas Abraitis [Mon, 12 Jun 2023 14:09:52 +0000 (17:09 +0300)]
bgpd: Use synchronous way to get labels from Zebra

Both the label manager and table manager zapi code send data requests via zapi
to zebra and then immediately listen for a response from zebra. The problem here
is of course that the listen part is throwing away any zapi command that is not
the one it is looking for.

ISIS/OSPF and PIM all have synchronous abilities via zapi, which they all
do through a special zapi connection to zebra. BGP needs to follow this model
as well. Additionally the new zclient_sync connection that should be created,
a once a second timer should wake up and read any data on the socket to
prevent problems too much data accumulating in the socket.

```
r3# sh bgp labelpool summary
Labelpool Summary
-----------------
Ledger:       3
InUse:        3
Requests:     0
LabelChunks:  1
Pending:      128
Reconnects:   1
r3# sh bgp labelpool inuse
Prefix                Label
---------------------------
10.0.0.1/32           16
192.168.31.0/24       17
192.168.32.0/24       18
r3#
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agotests: Adjust tests for BGP LU labelpool output
Donatas Abraitis [Tue, 13 Jun 2023 19:12:39 +0000 (22:12 +0300)]
tests: Adjust tests for BGP LU labelpool output

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agoMerge pull request #13801 from LabNConsulting/chopps/latest-checkpatch
Jafar Al-Gharaibeh [Tue, 20 Jun 2023 15:41:01 +0000 (10:41 -0500)]
Merge pull request #13801 from LabNConsulting/chopps/latest-checkpatch

Import latest checkpatch.pl from linux

22 months agoMerge pull request #13800 from idryzhov/fix-rip-ripd-crash
Russ White [Tue, 20 Jun 2023 14:40:52 +0000 (10:40 -0400)]
Merge pull request #13800 from idryzhov/fix-rip-ripd-crash

fix crashes in rip and ripng

22 months agoMerge pull request #13809 from LabNConsulting/chopps/mgmtdoc
Jafar Al-Gharaibeh [Tue, 20 Jun 2023 14:04:55 +0000 (09:04 -0500)]
Merge pull request #13809 from LabNConsulting/chopps/mgmtdoc

doc: start of mgmtd developer doc

22 months agoMerge pull request #13811 from dpward/ospfv3-seqnum-wrap
Russ White [Tue, 20 Jun 2023 13:26:19 +0000 (09:26 -0400)]
Merge pull request #13811 from dpward/ospfv3-seqnum-wrap

ospf6d: Increment sequence number correctly in Authentication Trailer

22 months agoMerge pull request #13728 from opensourcerouting/fix/addpath_drop_non_best_addpaths
Russ White [Tue, 20 Jun 2023 13:20:36 +0000 (09:20 -0400)]
Merge pull request #13728 from opensourcerouting/fix/addpath_drop_non_best_addpaths

bgpd: Implement neighbor X addpath-tx-best-selected command

22 months agoMerge pull request #13750 from louis-6wind/fix-no-retain-memory-usage
Russ White [Tue, 20 Jun 2023 13:19:50 +0000 (09:19 -0400)]
Merge pull request #13750 from louis-6wind/fix-no-retain-memory-usage

bgpd: fix memory usage of vpn no retain

22 months agoMerge pull request #13758 from cscarpitta/bugfix/fix-read-beyond-stream-isis-asla
Russ White [Tue, 20 Jun 2023 13:19:23 +0000 (09:19 -0400)]
Merge pull request #13758 from cscarpitta/bugfix/fix-read-beyond-stream-isis-asla

isisd: Fix read beyond end of stream of ASLA Sub-TLV parsing