]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
16 months agobgpd: add multiple paths support for draft ietf bgp4v2 in nlriTable
Francois Dumontet [Thu, 23 Nov 2023 09:45:24 +0000 (10:45 +0100)]
bgpd: add multiple paths support for draft ietf bgp4v2 in nlriTable

There is no support for dumping multiple paths for the same prefix.
The current implementation only takes the first available entry.

Fix this by walking over the list of available paths, ordered by peer.
The nlri index is set gradually for each path.

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
17 months agoMerge pull request #14858 from idryzhov/mgmtd-error-msg
Donatas Abraitis [Thu, 23 Nov 2023 06:09:45 +0000 (08:09 +0200)]
Merge pull request #14858 from idryzhov/mgmtd-error-msg

mgmtd: fix reply when running ds is not locked

17 months agoMerge pull request #14862 from louis-6wind/fix-ctx-iptable
Mark Stapp [Wed, 22 Nov 2023 20:47:47 +0000 (15:47 -0500)]
Merge pull request #14862 from louis-6wind/fix-ctx-iptable

zebra: fix dplane_ctx_iptable use-after-free

17 months agozebra: fix dplane_ctx_iptable use-after-free 14862/head
Louis Scalbert [Wed, 22 Nov 2023 17:21:25 +0000 (18:21 +0100)]
zebra: fix dplane_ctx_iptable use-after-free

Fix a crash because a use-after-free.

> =================================================================
> ==1249835==ERROR: AddressSanitizer: heap-use-after-free on address 0x604000074210 at pc 0x7fa1b42a652c bp 0x7ffc477a2aa0 sp 0x7ffc477a2a98
> READ of size 8 at 0x604000074210 thread T0
>     #0 0x7fa1b42a652b in list_delete_all_node git/frr/lib/linklist.c:299:20
>     #1 0x7fa1b42a683f in list_delete git/frr/lib/linklist.c:312:2
>     #2 0x5ee515 in dplane_ctx_free_internal git/frr/zebra/zebra_dplane.c:858:4
>     #3 0x5ee59c in dplane_ctx_free git/frr/zebra/zebra_dplane.c:884:2
>     #4 0x5ee544 in dplane_ctx_fini git/frr/zebra/zebra_dplane.c:905:2
>     #5 0x7045c0 in rib_process_dplane_results git/frr/zebra/zebra_rib.c:4928:4
>     #6 0x7fa1b4434fb2 in event_call git/frr/lib/event.c:1970:2
>     #7 0x7fa1b42a0ccf in frr_run git/frr/lib/libfrr.c:1213:3
>     #8 0x556808 in main git/frr/zebra/main.c:488:2
>     #9 0x7fa1b3d0bd09 in __libc_start_main csu/../csu/libc-start.c:308:16
>     #10 0x4453e9 in _start (/usr/lib/frr/zebra+0x4453e9)
>
> 0x604000074210 is located 0 bytes inside of 40-byte region [0x604000074210,0x604000074238)
> freed by thread T0 here:
>     #0 0x4bf1dd in free (/usr/lib/frr/zebra+0x4bf1dd)
>     #1 0x7fa1b42df0c0 in qfree git/frr/lib/memory.c:130:2
>     #2 0x7fa1b42a68ce in list_free_internal git/frr/lib/linklist.c:24:2
>     #3 0x7fa1b42a6870 in list_delete git/frr/lib/linklist.c:313:2
>     #4 0x5ee515 in dplane_ctx_free_internal git/frr/zebra/zebra_dplane.c:858:4
>     #5 0x5ee59c in dplane_ctx_free git/frr/zebra/zebra_dplane.c:884:2
>     #6 0x5ee544 in dplane_ctx_fini git/frr/zebra/zebra_dplane.c:905:2
>     #7 0x7045c0 in rib_process_dplane_results git/frr/zebra/zebra_rib.c:4928:4
>     #8 0x7fa1b4434fb2 in event_call git/frr/lib/event.c:1970:2
>     #9 0x7fa1b42a0ccf in frr_run git/frr/lib/libfrr.c:1213:3
>     #10 0x556808 in main git/frr/zebra/main.c:488:2
>     #11 0x7fa1b3d0bd09 in __libc_start_main csu/../csu/libc-start.c:308:16
>
> previously allocated by thread T0 here:
>     #0 0x4bf5d2 in calloc (/usr/lib/frr/zebra+0x4bf5d2)
>     #1 0x7fa1b42dee18 in qcalloc git/frr/lib/memory.c:105:27
>     #2 0x7fa1b42a3784 in list_new git/frr/lib/linklist.c:18:9
>     #3 0x6d165f in pbr_iptable_alloc_intern git/frr/zebra/zebra_pbr.c:1015:29
>     #4 0x7fa1b426ad1f in hash_get git/frr/lib/hash.c:147:13
>     #5 0x6d15f2 in zebra_pbr_add_iptable git/frr/zebra/zebra_pbr.c:1030:13
>     #6 0x5db2a3 in zread_iptable git/frr/zebra/zapi_msg.c:3759:3
>     #7 0x5e365d in zserv_handle_commands git/frr/zebra/zapi_msg.c:4039:3
>     #8 0x7e09fc in zserv_process_messages git/frr/zebra/zserv.c:520:3
>     #9 0x7fa1b4434fb2 in event_call git/frr/lib/event.c:1970:2
>     #10 0x7fa1b42a0ccf in frr_run git/frr/lib/libfrr.c:1213:3
>     #11 0x556808 in main git/frr/zebra/main.c:488:2
>     #12 0x7fa1b3d0bd09 in __libc_start_main csu/../csu/libc-start.c:308:16

Fixes: 1cc380679e ("zebra: Actually free all memory associated ctx->u.iptable.interface_name_list")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
17 months agoMerge pull request #14830 from fdumontet6WIND/snmpv2
Donatas Abraitis [Wed, 22 Nov 2023 12:45:15 +0000 (14:45 +0200)]
Merge pull request #14830 from fdumontet6WIND/snmpv2

tests: bgp_snmp_bgp4v2mib fix some random failure

17 months agoMerge pull request #14815 from idryzhov/lib-mgmt-deps
Christian Hopps [Wed, 22 Nov 2023 09:51:40 +0000 (10:51 +0100)]
Merge pull request #14815 from idryzhov/lib-mgmt-deps

Remove lib dependency on mgmtd

17 months agotests: bgp_snmp_bgp4v2mib fix some random failure 14830/head
Francois Dumontet [Sun, 19 Nov 2023 21:55:06 +0000 (22:55 +0100)]
tests: bgp_snmp_bgp4v2mib fix some random failure

avoid to consider additionnal traps randomly received later

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
17 months agoMerge pull request #14850 from donaldsharp/IFNAMSIZ_GET_YOUR_SHIT_TOGETHER
Donatas Abraitis [Wed, 22 Nov 2023 07:13:58 +0000 (09:13 +0200)]
Merge pull request #14850 from donaldsharp/IFNAMSIZ_GET_YOUR_SHIT_TOGETHER

*: Let's use the native IFNAMSIZ instead of INTERFACE_NAMSIZ

17 months agomgmtd: fix reply when running ds is not locked 14858/head
Igor Ryzhov [Tue, 21 Nov 2023 21:18:40 +0000 (23:18 +0200)]
mgmtd: fix reply when running ds is not locked

At this stage, we should send a SET_CFG reply, not COMMIT_CFG reply.
Commit request is not yet initialized.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
17 months agoMerge pull request #14834 from opensourcerouting/zclient-nexthop-update
Donald Sharp [Tue, 21 Nov 2023 15:56:47 +0000 (10:56 -0500)]
Merge pull request #14834 from opensourcerouting/zclient-nexthop-update

*: move common NHT update decoding bits into lib/

17 months agoMerge pull request #14845 from opensourcerouting/fix/bgp_conditional_double_free
Donald Sharp [Tue, 21 Nov 2023 15:48:33 +0000 (10:48 -0500)]
Merge pull request #14845 from opensourcerouting/fix/bgp_conditional_double_free

bgpd: Prevent USE case for conditional advertisements with `set` actions

17 months agoMerge pull request #14757 from ryndia/aspath_fix
Russ White [Tue, 21 Nov 2023 15:39:59 +0000 (10:39 -0500)]
Merge pull request #14757 from ryndia/aspath_fix

bgpd:aspath leak fix

17 months ago*: Let's use the native IFNAMSIZ instead of INTERFACE_NAMSIZ 14850/head
Donald Sharp [Tue, 21 Nov 2023 13:08:29 +0000 (08:08 -0500)]
*: Let's use the native IFNAMSIZ instead of INTERFACE_NAMSIZ

INTERFACE_NAMSIZ is just a redefine of IFNAMSIZ and IFNAMSIZ
is the standard for interface name length on all platforms
that FRR currently compiles on.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agoMerge pull request #14710 from teletajp/fix_show_ospf_gr_helper_cmd
Donatas Abraitis [Tue, 21 Nov 2023 09:39:31 +0000 (11:39 +0200)]
Merge pull request #14710 from teletajp/fix_show_ospf_gr_helper_cmd

ospfd:fix show_ip_ospf_gr_helper

17 months agobgpd: Flush attrs only if we don't have to announce a conditional route 14845/head
Donatas Abraitis [Tue, 21 Nov 2023 08:40:58 +0000 (10:40 +0200)]
bgpd: Flush attrs only if we don't have to announce a conditional route

To avoid USE:

```
==587645==ERROR: AddressSanitizer: heap-use-after-free on address 0x604000074050 at pc 0x55b34337d96c bp 0x7ffda59bb4c0 sp 0x7ffda59bb4b0
READ of size 8 at 0x604000074050 thread T0
    0 0x55b34337d96b in bgp_attr_flush bgpd/bgp_attr.c:1289
    1 0x55b34368ef85 in bgp_conditional_adv_routes bgpd/bgp_conditional_adv.c:111
    2 0x55b34368ff58 in bgp_conditional_adv_timer bgpd/bgp_conditional_adv.c:301
    3 0x7f7d41cdf81c in event_call lib/event.c:1980
    4 0x7f7d41c1da37 in frr_run lib/libfrr.c:1214
    5 0x55b343371e22 in main bgpd/bgp_main.c:510
    6 0x7f7d41517082 in __libc_start_main ../csu/libc-start.c:308
    7 0x55b3433769fd in _start (/usr/lib/frr/bgpd+0x2e29fd)

0x604000074050 is located 0 bytes inside of 40-byte region [0x604000074050,0x604000074078)
freed by thread T0 here:
    #0 0x7f7d4207540f in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:122
    1 0x55b343396afd in community_free bgpd/bgp_community.c:41
    2 0x55b343396afd in community_free bgpd/bgp_community.c:28
    3 0x55b343397373 in community_intern bgpd/bgp_community.c:458
    4 0x55b34337bed4 in bgp_attr_intern bgpd/bgp_attr.c:967
    5 0x55b34368165b in bgp_advertise_attr_intern bgpd/bgp_advertise.c:106
    6 0x55b3435277d7 in bgp_adj_out_set_subgroup bgpd/bgp_updgrp_adv.c:587
    7 0x55b34368f36b in bgp_conditional_adv_routes bgpd/bgp_conditional_adv.c:125
    8 0x55b34368ff58 in bgp_conditional_adv_timer bgpd/bgp_conditional_adv.c:301
    9 0x7f7d41cdf81c in event_call lib/event.c:1980
    10 0x7f7d41c1da37 in frr_run lib/libfrr.c:1214
    11 0x55b343371e22 in main bgpd/bgp_main.c:510
    12 0x7f7d41517082 in __libc_start_main ../csu/libc-start.c:308

previously allocated by thread T0 here:
    #0 0x7f7d42075a06 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:153
    1 0x7f7d41c3c28e in qcalloc lib/memory.c:105
    2 0x55b3433976e8 in community_dup bgpd/bgp_community.c:514
    3 0x55b34350273a in route_set_community bgpd/bgp_routemap.c:2589
    4 0x7f7d41c96c06 in route_map_apply_ext lib/routemap.c:2690
    5 0x55b34368f2d8 in bgp_conditional_adv_routes bgpd/bgp_conditional_adv.c:107
    6 0x55b34368ff58 in bgp_conditional_adv_timer bgpd/bgp_conditional_adv.c:301
    7 0x7f7d41cdf81c in event_call lib/event.c:1980
    8 0x7f7d41c1da37 in frr_run lib/libfrr.c:1214
    9 0x55b343371e22 in main bgpd/bgp_main.c:510
    10 0x7f7d41517082 in __libc_start_main ../csu/libc-start.c:308
```

And also a crash:

```
(gdb) bt
0  raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
1  0x00007ff3b7048ce0 in core_handler (signo=6, siginfo=0x7ffc8cf724b0, context=<optimized out>)
    at lib/sigevent.c:246
2  <signal handler called>
3  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
4  0x00007ff3b6bb8859 in __GI_abort () at abort.c:79
5  0x00007ff3b6c2326e in __libc_message (action=action@entry=do_abort,
    fmt=fmt@entry=0x7ff3b6d4d298 "%s\n") at ../sysdeps/posix/libc_fatal.c:155
6  0x00007ff3b6c2b2fc in malloc_printerr (
    str=str@entry=0x7ff3b6d4f628 "double free or corruption (fasttop)") at malloc.c:5347
7  0x00007ff3b6c2cc65 in _int_free (av=0x7ff3b6d82b80 <main_arena>, p=0x555c8fa70a10, have_lock=0)
    at malloc.c:4266
8  0x0000555c8da94bd3 in community_free (com=0x7ffc8cf72e70) at bgpd/bgp_community.c:41
9  community_free (com=com@entry=0x7ffc8cf72e70) at bgpd/bgp_community.c:28
10 0x0000555c8da8afc1 in bgp_attr_flush (attr=attr@entry=0x7ffc8cf73040) at bgpd/bgp_attr.c:1290
11 0x0000555c8dbc0760 in bgp_conditional_adv_routes (peer=peer@entry=0x555c8fa627c0,
    afi=afi@entry=AFI_IP, safi=SAFI_UNICAST, table=table@entry=0x555c8fa510b0, rmap=0x555c8fa71cb0,
    update_type=UPDATE_TYPE_ADVERTISE) at bgpd/bgp_conditional_adv.c:111
12 0x0000555c8dbc0b75 in bgp_conditional_adv_timer (t=<optimized out>)
    at bgpd/bgp_conditional_adv.c:301
13 0x00007ff3b705b84c in event_call (thread=thread@entry=0x7ffc8cf73440) at lib/event.c:1980
14 0x00007ff3b700bf98 in frr_run (master=0x555c8f27c090) at lib/libfrr.c:1214
15 0x0000555c8da85f05 in main (argc=<optimized out>, argv=0x7ffc8cf736a8) at bgpd/bgp_main.c:510
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
17 months agotests: Set community for conditionally advertised routes
Donatas Abraitis [Tue, 21 Nov 2023 08:38:12 +0000 (10:38 +0200)]
tests: Set community for conditionally advertised routes

Just to make sure we don't crash bgpd with double-free if an existing route
already exists.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
17 months agoMerge pull request #14835 from donaldsharp/multipath_evpn_encap_attr
Donatas Abraitis [Tue, 21 Nov 2023 07:08:40 +0000 (09:08 +0200)]
Merge pull request #14835 from donaldsharp/multipath_evpn_encap_attr

zebra: Fix fpm multipath encap addition

17 months agoMerge pull request #14813 from idryzhov/vtysh-file-lock
Donald Sharp [Mon, 20 Nov 2023 20:18:42 +0000 (15:18 -0500)]
Merge pull request #14813 from idryzhov/vtysh-file-lock

vtysh: clean vtysh_file_locked when exiting config node

17 months agoMerge pull request #14833 from opensourcerouting/fix/frrtrace_bmp
Donald Sharp [Mon, 20 Nov 2023 20:17:13 +0000 (15:17 -0500)]
Merge pull request #14833 from opensourcerouting/fix/frrtrace_bmp

bgpd: Fix frrtrace arguments for bmp_eor tracing

17 months agoMerge pull request #14823 from opensourcerouting/isis-adj-cleanup
Donald Sharp [Mon, 20 Nov 2023 15:44:25 +0000 (10:44 -0500)]
Merge pull request #14823 from opensourcerouting/isis-adj-cleanup

isisd: remove unused router_address fields

17 months agoMerge pull request #14825 from mjstapp/fix_opcode_switches
Donald Sharp [Mon, 20 Nov 2023 15:43:16 +0000 (10:43 -0500)]
Merge pull request #14825 from mjstapp/fix_opcode_switches

zebra: reduce number of switch statements with dplane opcodes

17 months agoMerge pull request #14831 from opensourcerouting/libyang-multi-err-ifdef
Christian Hopps [Mon, 20 Nov 2023 14:56:16 +0000 (15:56 +0100)]
Merge pull request #14831 from opensourcerouting/libyang-multi-err-ifdef

lib: use LYD_VALIDATE_MULTI_ERROR only if available

17 months agozebra: Fix fpm multipath encap addition 14835/head
Donald Sharp [Fri, 17 Nov 2023 21:57:20 +0000 (16:57 -0500)]
zebra: Fix fpm multipath encap addition

The fpm code path in building a ecmp route for evpn has
a bug that caused it to not add the encap attribute to
the netlink message.  See #f0f7b285b99dbd971400d33feea007232c0bd4a9
for the single path case being fixed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agolib: make zapi_nexthop_update_decode private 14834/head
David Lamparter [Mon, 20 Nov 2023 10:22:50 +0000 (11:22 +0100)]
lib: make zapi_nexthop_update_decode private

zapi_nexthop_update_decode() is no longer called externally.

Also move the comment to zclient->nexthop_update where it now belongs.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
17 months agobgpd: use `zclient->nexthop_update`
David Lamparter [Tue, 29 Nov 2022 11:09:45 +0000 (12:09 +0100)]
bgpd: use `zclient->nexthop_update`

Same as before.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
17 months agoospf6d: use `zclient->nexthop_update`
David Lamparter [Tue, 29 Nov 2022 11:09:45 +0000 (12:09 +0100)]
ospf6d: use `zclient->nexthop_update`

Same as before.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
17 months agoospfd: use `zclient->nexthop_update`
David Lamparter [Mon, 20 Nov 2023 10:00:48 +0000 (11:00 +0100)]
ospfd: use `zclient->nexthop_update`

Same as before.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
17 months agostaticd: use `zclient->nexthop_update`
David Lamparter [Tue, 29 Nov 2022 11:09:45 +0000 (12:09 +0100)]
staticd: use `zclient->nexthop_update`

Same as before.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
17 months agosharpd: use `zclient->nexthop_update`
David Lamparter [Tue, 29 Nov 2022 11:09:45 +0000 (12:09 +0100)]
sharpd: use `zclient->nexthop_update`

Same as above.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
17 months agopimd: use `zclient->nexthop_update`
David Lamparter [Tue, 29 Nov 2022 11:09:45 +0000 (12:09 +0100)]
pimd: use `zclient->nexthop_update`

Same as before, use shared nexthop decode function.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
17 months agopbrd: use `zclient->nexthop_update`
David Lamparter [Tue, 29 Nov 2022 11:09:45 +0000 (12:09 +0100)]
pbrd: use `zclient->nexthop_update`

Have the library decode the nexthop.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
17 months agolib: add common NHT update decode callback
David Lamparter [Tue, 29 Nov 2022 11:09:45 +0000 (12:09 +0100)]
lib: add common NHT update decode callback

All users of `ZEBRA_NEXTHOP_UPDATE` check the VRF and then call into
`zapi_nexthop_update_decode` before further processing.  Begin moving
this into common code in lib/.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
17 months agobgpd: Fix frrtrace arguments for bmp_eor tracing 14833/head
Donatas Abraitis [Mon, 20 Nov 2023 10:21:13 +0000 (12:21 +0200)]
bgpd: Fix frrtrace arguments for bmp_eor tracing

Arguments number was wrong.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
17 months agolib: use LYD_VALIDATE_MULTI_ERROR only if available 14831/head
David Lamparter [Mon, 20 Nov 2023 09:29:57 +0000 (10:29 +0100)]
lib: use LYD_VALIDATE_MULTI_ERROR only if available

LYD_VALIDATE_MULTI_ERROR was added in libyang 2.1.36.  The currently
enforced minimum of libyang is 2.0.0.  Stick an #ifdef around it.

Fixes: 51a2a4b3f471 ("lib: print all errors when validating a config")
Cc: Igor Ryzhov <iryzhov@nfware.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
17 months agoMerge pull request #14824 from opensourcerouting/ospf6-p2xp-fixuninit
mobash-rasool [Sun, 19 Nov 2023 16:58:51 +0000 (22:28 +0530)]
Merge pull request #14824 from opensourcerouting/ospf6-p2xp-fixuninit

ospf6d: fix uninitialized value warning in p2xp

17 months agoMerge pull request #14657 from idryzhov/mgmtd-remove-batch-ids
Christian Hopps [Sat, 18 Nov 2023 04:59:44 +0000 (05:59 +0100)]
Merge pull request #14657 from idryzhov/mgmtd-remove-batch-ids

mgmtd, lib: remove batch ids from all messages

17 months agoMerge pull request #14827 from qlyoung/doc-restore-frr-theme
Donatas Abraitis [Fri, 17 Nov 2023 21:03:37 +0000 (23:03 +0200)]
Merge pull request #14827 from qlyoung/doc-restore-frr-theme

doc: fix docs path to requirements.txt

17 months agodoc: fix docs path to requirements.txt 14827/head
Quentin Young [Fri, 17 Nov 2023 17:11:09 +0000 (12:11 -0500)]
doc: fix docs path to requirements.txt

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
17 months agoMerge pull request #14806 from mxyns/master
Donatas Abraitis [Fri, 17 Nov 2023 14:34:22 +0000 (16:34 +0200)]
Merge pull request #14806 from mxyns/master

bgpd: bmp bgp asn & router_id coverity fix

17 months agoospf6d: fix uninitialized value warning in p2xp 14824/head
David Lamparter [Fri, 17 Nov 2023 13:39:27 +0000 (14:39 +0100)]
ospf6d: fix uninitialized value warning in p2xp

GCC is complaining prev_cost may be used uninitialized.  It really
can't, but let's get rid of the warning.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
17 months agozebra: reduce number of switch statements with dplane opcodes 14825/head
Mark Stapp [Fri, 17 Nov 2023 13:40:58 +0000 (08:40 -0500)]
zebra: reduce number of switch statements with dplane opcodes

Replace several switch blocks that contain every dplane opcode
with simpler sets of if()s. In these cases the code only
uses a couple of opcodes.

Signed-off-by: Mark Stapp <mjs@labn.net>
17 months agoMerge pull request #14814 from idryzhov/staticd-debug
Donald Sharp [Fri, 17 Nov 2023 12:25:40 +0000 (07:25 -0500)]
Merge pull request #14814 from idryzhov/staticd-debug

staticd: fix debug commands

17 months agolib, mgmtd: remove function duplication 14815/head
Igor Ryzhov [Fri, 17 Nov 2023 01:27:00 +0000 (02:27 +0100)]
lib, mgmtd: remove function duplication

And also remove lib dependency on mgmtd.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
17 months agolib, mgmtd: move common header to lib
Igor Ryzhov [Thu, 16 Nov 2023 19:31:52 +0000 (20:31 +0100)]
lib, mgmtd: move common header to lib

The common header included from lib and other daemons should be located
in lib, not in mgmt directory.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
17 months agoMerge pull request #14812 from qlyoung/doc-restore-frr-theme
Donatas Abraitis [Fri, 17 Nov 2023 10:07:30 +0000 (12:07 +0200)]
Merge pull request #14812 from qlyoung/doc-restore-frr-theme

doc: restore frr docs theme

17 months agostaticd: fix debug commands 14814/head
Igor Ryzhov [Fri, 17 Nov 2023 01:27:55 +0000 (02:27 +0100)]
staticd: fix debug commands

Debug commands should be installed in staticd, not in mgmtd.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
17 months agovtysh: clean vtysh_file_locked when exiting config node 14813/head
Igor Ryzhov [Thu, 16 Nov 2023 19:00:07 +0000 (20:00 +0100)]
vtysh: clean vtysh_file_locked when exiting config node

The flag should be cleared to make sure it's not reused the next time
we enter the config node.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
17 months agodoc: restore frr docs theme 14812/head
Quentin Young [Thu, 16 Nov 2023 23:44:11 +0000 (18:44 -0500)]
doc: restore frr docs theme

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
17 months agoisisd: remove unused router_address fields 14823/head
David Lamparter [Thu, 16 Nov 2023 13:14:10 +0000 (14:14 +0100)]
isisd: remove unused router_address fields

These were added in e38e0df01ad3 but never used anywhere.  Also the code
grabs any random /32 or /128 that is directly connected to the adjacent
router, which may not even be an address of that router itself.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
17 months agoMerge pull request #14807 from Keelan10/fix-babel-int-delete-leak
Donatas Abraitis [Thu, 16 Nov 2023 12:54:03 +0000 (14:54 +0200)]
Merge pull request #14807 from Keelan10/fix-babel-int-delete-leak

babeld: Free IPv4 Memory in babel_interface_free

17 months agobabeld: Free IPv4 Memory in babel_interface_free 14807/head
Keelan10 [Wed, 15 Nov 2023 20:51:46 +0000 (00:51 +0400)]
babeld: Free IPv4 Memory in babel_interface_free

Ensure proper memory cleanup by freeing the `babel_ifp->ipv4` when
babel interface is deleted. This prevents memory leaks.

The ASan leak log for reference:

```
***********************************************************************************
Address Sanitizer Error detected in all_protocol_startup.test_all_protocol_startup/r1.asan.babeld.4141

=================================================================
==4141==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 40 byte(s) in 10 object(s) allocated from:
    #0 0x7f1cde6a9b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x562b8eff328d in babel_interface_address_add babeld/babel_interface.c:112
    #2 0x7f1cde1772cb in zclient_read lib/zclient.c:4425
    #3 0x7f1cde14729c in event_call lib/event.c:1980
    #4 0x7f1cde08a3bf in frr_run lib/libfrr.c:1214
    #5 0x562b8eff481b in main babeld/babel_main.c:202
    #6 0x7f1cdd8acc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

SUMMARY: AddressSanitizer: 40 byte(s) leaked in 10 allocation(s).
***********************************************************************************
```

Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
17 months agoMerge pull request #14792 from mobash-rasool/fixes2
Donald Sharp [Wed, 15 Nov 2023 18:19:53 +0000 (13:19 -0500)]
Merge pull request #14792 from mobash-rasool/fixes2

pim6d: Fix memory leaks

17 months agoMerge pull request #14800 from idryzhov/nb-validate-errors
Donald Sharp [Wed, 15 Nov 2023 18:19:11 +0000 (13:19 -0500)]
Merge pull request #14800 from idryzhov/nb-validate-errors

Print all errors when validating NB configuration

17 months agoMerge pull request #14802 from Keelan10/fix-nht-leak
Donald Sharp [Wed, 15 Nov 2023 17:22:29 +0000 (12:22 -0500)]
Merge pull request #14802 from Keelan10/fix-nht-leak

sharpd: Set Callback Function for Memory Cleanup

17 months agoMerge pull request #14803 from Keelan10/fix-babel-leak
Donald Sharp [Wed, 15 Nov 2023 14:54:36 +0000 (09:54 -0500)]
Merge pull request #14803 from Keelan10/fix-babel-leak

babeld: Free IPv4 Memory in interface_reset

17 months agobgpd: bmp bgp asn & router_id coverity fix 14806/head
Maxou [Wed, 15 Nov 2023 13:37:03 +0000 (14:37 +0100)]
bgpd: bmp bgp asn & router_id coverity fix

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agoospfd: fix show_ip_ospf_gr_helper 14710/head
teletajp [Wed, 1 Nov 2023 09:25:07 +0000 (12:25 +0300)]
ospfd: fix show_ip_ospf_gr_helper

Fix for the command "show ip ospf vrf NAME graceful-restart helper".
FRR did not show information by vrf's name.
If i have router ospf vrf red, vtysh's command
'show ip ospf vrf red graceful-restart helper' will not show anything.
But command 'show ip ospf vrf all graceful-restart helper' will work
normally. This fix fixes the display of information by vrf's name.

Example:
frr1# show ip ospf vrf vrf-1 graceful-restart helper
VRF Name: vrf-1

       OSPF Router with ID (192.168.255.81)

 Graceful restart helper support enabled.
 Strict LSA check is enabled.
 Helper supported for Planned and Unplanned Restarts.
 Supported Graceful restart interval: 1800(in seconds).

Signed-off-by: teletajp <teletajp@yandex.ru>
17 months agolib: print all errors when validating a config 14800/head
Igor Ryzhov [Tue, 14 Nov 2023 18:57:05 +0000 (19:57 +0100)]
lib: print all errors when validating a config

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
17 months agoMerge pull request #14798 from Keelan10/zebra-fix-json-leak
Donatas Abraitis [Wed, 15 Nov 2023 12:27:21 +0000 (14:27 +0200)]
Merge pull request #14798 from Keelan10/zebra-fix-json-leak

zebra: Refactor memory allocation in zebra_rnh.c

17 months agobabeld: Free IPv4 Memory in interface_reset 14803/head
Keelan10 [Wed, 15 Nov 2023 08:53:54 +0000 (12:53 +0400)]
babeld: Free IPv4 Memory in interface_reset

Release memory allocated for the IPv4 address during the interface reset.
The addition of `free(babel_ifp->ipv4)` ensures proper cleanup, preventing
potential memory leaks.

The ASan leak log for reference:

```
***********************************************************************************
Address Sanitizer Error detected in babel_topo1.test_babel_topo1/r2.asan.babeld.18864

=================================================================
==18864==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 8 byte(s) in 2 object(s) allocated from:
    #0 0x7f3f4531bb40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x55c1806cb28d in babel_interface_address_add babeld/babel_interface.c:112
    #2 0x7f3f44de9e29 in zclient_read lib/zclient.c:4425
    #3 0x7f3f44db9dfa in event_call lib/event.c:1965
    #4 0x7f3f44cfd3bf in frr_run lib/libfrr.c:1214
    #5 0x55c1806cc81b in main babeld/babel_main.c:202
    #6 0x7f3f4451fc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

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

Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
17 months agosharpd: Set Callback Function for Memory Cleanup 14802/head
Keelan10 [Wed, 15 Nov 2023 07:50:09 +0000 (11:50 +0400)]
sharpd: Set Callback Function for Memory Cleanup

Implement a callback function for memory cleanup of sharp_nh_tracker.
Specifically, set `sharp_nh_tracker_free` as the deletion function for the `sg.nhs` list.
This ensures proper cleanup of resources when elements are removed.

The ASan leak log for reference:

```
***********************************************************************************
Address Sanitizer Error detected in zebra_nht_resolution.test_verify_nh_resolution/r1.asan.sharpd.32320

=================================================================
==32320==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7f4ee812ad28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x7f4ee7b291cc in qcalloc lib/memory.c:105
    #2 0x5582be672011 in sharp_nh_tracker_get sharpd/sharp_nht.c:36
    #3 0x5582be680b42 in watch_nexthop_v4_magic sharpd/sharp_vty.c:139
    #4 0x5582be680b42 in watch_nexthop_v4 sharpd/sharp_vty_clippy.c:192
    #5 0x7f4ee7aac0b1 in cmd_execute_command_real lib/command.c:978
    #6 0x7f4ee7aac575 in cmd_execute_command lib/command.c:1036
    #7 0x7f4ee7aac9f4 in cmd_execute lib/command.c:1203
    #8 0x7f4ee7bd50bb in vty_command lib/vty.c:594
    #9 0x7f4ee7bd5566 in vty_execute lib/vty.c:1357
    #10 0x7f4ee7bdde37 in vtysh_read lib/vty.c:2365
    #11 0x7f4ee7bc8dfa in event_call lib/event.c:1965
    #12 0x7f4ee7b0c3bf in frr_run lib/libfrr.c:1214
    #13 0x5582be671252 in main sharpd/sharp_main.c:188
    #14 0x7f4ee6f1bc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

SUMMARY: AddressSanitizer: 64 byte(s) leaked in 1 allocation(s).
***********************************************************************************
```

Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
17 months agoMerge pull request #14796 from donaldsharp/ospf_bsd_double_whammy_no_whammy
Donatas Abraitis [Wed, 15 Nov 2023 07:39:31 +0000 (09:39 +0200)]
Merge pull request #14796 from donaldsharp/ospf_bsd_double_whammy_no_whammy

lib: Prevent infinite loop in ospf

17 months agolib: fix printing multiple yang errors
Igor Ryzhov [Tue, 14 Nov 2023 18:55:00 +0000 (19:55 +0100)]
lib: fix printing multiple yang errors

When printing multiple YANG errors, we should print paths for all of
them, not only for the last one.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
17 months agozebra: Refactor memory allocation in zebra_rnh.c 14798/head
Keelan10 [Tue, 14 Nov 2023 21:57:04 +0000 (01:57 +0400)]
zebra: Refactor memory allocation in zebra_rnh.c

Fix memory leaks by allocating `json_segs` conditionally on `nexthop->nh_srv6->seg6_segs`.
The previous code allocated memory even when not in use or attached to the JSON tree.

The ASan leak log for reference:

```
Direct leak of 3240 byte(s) in 45 object(s) allocated from:
    #0 0x7f6e84a35d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x7f6e83de9e6f in json_object_new_array (/lib/x86_64-linux-gnu/libjson-c.so.3+0x3e6f)
    #2 0x564dcab5c1a6 in vty_show_ip_route zebra/zebra_vty.c:705
    #3 0x564dcab5cc71 in do_show_route_helper zebra/zebra_vty.c:955
    #4 0x564dcab5d418 in do_show_ip_route zebra/zebra_vty.c:1039
    #5 0x564dcab63ee5 in show_route_magic zebra/zebra_vty.c:1878
    #6 0x564dcab63ee5 in show_route zebra/zebra_vty_clippy.c:659
    #7 0x7f6e843b6fb1 in cmd_execute_command_real lib/command.c:978
    #8 0x7f6e843b7475 in cmd_execute_command lib/command.c:1036
    #9 0x7f6e843b78f4 in cmd_execute lib/command.c:1203
    #10 0x7f6e844dfe3b in vty_command lib/vty.c:594
    #11 0x7f6e844e02e6 in vty_execute lib/vty.c:1357
    #12 0x7f6e844e8bb7 in vtysh_read lib/vty.c:2365
    #13 0x7f6e844d3b7a in event_call lib/event.c:1965
    #14 0x7f6e844172b0 in frr_run lib/libfrr.c:1214
    #15 0x564dcaa50e81 in main zebra/main.c:488
    #16 0x7f6e837f7c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 11520 byte(s) in 45 object(s) allocated from:
    #0 0x7f6e84a35d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x7f6e83de88c0 in array_list_new (/lib/x86_64-linux-gnu/libjson-c.so.3+0x28c0)

Indirect leak of 1080 byte(s) in 45 object(s) allocated from:
    #0 0x7f6e84a35d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x7f6e83de8897 in array_list_new (/lib/x86_64-linux-gnu/libjson-c.so.3+0x2897)
```

Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
Signed-off-by: ryndia <dindyalsarvesh@gmail.com>
17 months agolib: Prevent infinite loop in ospf 14796/head
Donald Sharp [Tue, 14 Nov 2023 16:00:54 +0000 (11:00 -0500)]
lib: Prevent infinite loop in ospf

For some series of calls in FREEBSD setting the SO_RCVBUF size will
always fail under freebsd.  This is no bueno since the
setsockopt_so_recvbuf call goes into an infinite loop.

(gdb) bt
 0  setsockopt () at setsockopt.S:4
 1  0x0000000083065870 in setsockopt_so_recvbuf (sock=15, size=0) at lib/sockopt.c:26
 2  0x00000000002bd200 in ospf_ifp_sock_init (ifp=<optimized out>, ifp@entry=0x8d1dd500) at ospfd/ospf_network.c:290
 3  0x00000000002ad1e0 in ospf_if_new (ospf=0x8eefc000, ifp=0x8d1dd500, p=0x8eecf1c0) at ospfd/ospf_interface.c:276
 4  0x0000000000304ee0 in add_ospf_interface (co=0x8eecbe10, area=0x8d192100) at ospfd/ospfd.c:1115
 5  0x00000000003050fc in ospf_network_run_interface (ospf=0x8eefc000, ifp=0x8d1dd500, p=0x80ff63f8, given_area=0x8d192100)
    at ospfd/ospfd.c:1460
 6  ospf_network_run (p=0x80ff63f8, area=0x8d192100) at ospfd/ospfd.c:1474
 7  ospf_network_set (ospf=ospf@entry=0x8eefc000, p=p@entry=0x80ff63f8, area_id=..., df=<optimized out>) at ospfd/ospfd.c:1247
 8  0x00000000002e876c in ospf_network_area (self=<optimized out>, vty=0x8eef3180, argc=<optimized out>, argv=<optimized out>)
    at ospfd/ospf_vty.c:560
 9  0x0000000083006f24 in cmd_execute_command_real (vline=vline@entry=0x8eee9100, vty=vty@entry=0x8eef3180, cmd=<optimized out>,
    cmd@entry=0x0, up_level=<optimized out>) at lib/command.c:978
 10 0x0000000083006b30 in cmd_execute_command (vline=0x8eee9100, vty=vty@entry=0x8eef3180, cmd=cmd@entry=0x0, vtysh=vtysh@entry=0)
    at lib/command.c:1037
 11 0x0000000083007044 in cmd_execute (vty=vty@entry=0x8eef3180, cmd=cmd@entry=0x8eefb000 "network 192.168.64.0/24 area 0.0.0.0",
    matched=0x0, vtysh=0) at lib/command.c:1203
 12 0x000000008307e9cc in vty_command (vty=0x8eef3180, buf=0x8eefb000 "network 192.168.64.0/24 area 0.0.0.0") at lib/vty.c:594
 13 vty_execute (vty=vty@entry=0x8eef3180) at lib/vty.c:1357
 14 0x000000008307ce40 in vtysh_read (thread=<optimized out>) at lib/vty.c:2365
 15 0x0000000083073db0 in event_call (thread=thread@entry=0x80ff88a0) at lib/event.c:1965
 16 0x000000008302c604 in frr_run (master=0x8d188140) at lib/libfrr.c:1214
 17 0x000000000029c330 in main (argc=6, argv=<optimized out>) at ospfd/ospf_main.c:252
(gdb)

Force the setsockopt function to quit when the value we are passing no
longer makes any sense.

Fixes: #14790
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agobgpd:aspath leak fix 14757/head
ryndia [Wed, 8 Nov 2023 17:26:20 +0000 (21:26 +0400)]
bgpd:aspath leak fix

The function aspath_remove_private_asns was using an aspath to perform some operation and didnt free it after usage leading to the leak below.

***********************************************************************************
Address Sanitizer Error detected in bgp_remove_private_as_route_map.test_bgp_remove_private_as_route_map/r2.asan.bgpd.27074

=================================================================
==27074==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 80 byte(s) in 2 object(s) allocated from:
    #0 0x7fd0a4b95d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x7fd0a45932ff in qcalloc lib/memory.c:105
    #2 0x562b630b44cc in aspath_dup bgpd/bgp_aspath.c:689
    #3 0x562b62f48498 in route_set_aspath_prepend bgpd/bgp_routemap.c:2283
    #4 0x7fd0a45ec39a in route_map_apply_ext lib/routemap.c:2690
    #5 0x562b62efbb1f in subgroup_announce_check bgpd/bgp_route.c:2434
    #6 0x562b62efd4e2 in subgroup_process_announce_selected bgpd/bgp_route.c:2990
    #7 0x562b62f6a829 in subgroup_announce_table bgpd/bgp_updgrp_adv.c:765
    #8 0x562b62f6acbb in subgroup_announce_route bgpd/bgp_updgrp_adv.c:818
    #9 0x562b62f6ae90 in subgroup_coalesce_timer bgpd/bgp_updgrp_adv.c:368
    #10 0x7fd0a463322a in event_call lib/event.c:1970
    #11 0x7fd0a4576566 in frr_run lib/libfrr.c:1214
    #12 0x562b62dbd8f1 in main bgpd/bgp_main.c:510
    #13 0x7fd0a35b8c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Direct leak of 80 byte(s) in 2 object(s) allocated from:
    #0 0x7fd0a4b95d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x7fd0a45932ff in qcalloc lib/memory.c:105
    #2 0x562b630b44cc in aspath_dup bgpd/bgp_aspath.c:689
    #3 0x562b62f48498 in route_set_aspath_prepend bgpd/bgp_routemap.c:2283
    #4 0x7fd0a45ec39a in route_map_apply_ext lib/routemap.c:2690
    #5 0x562b62efbb1f in subgroup_announce_check bgpd/bgp_route.c:2434
    #6 0x562b62efd4e2 in subgroup_process_announce_selected bgpd/bgp_route.c:2990
    #7 0x562b62f6a829 in subgroup_announce_table bgpd/bgp_updgrp_adv.c:765
    #8 0x562b62f6acbb in subgroup_announce_route bgpd/bgp_updgrp_adv.c:818
    #9 0x562b62f5b844 in updgrp_policy_update_walkcb bgpd/bgp_updgrp.c:1685
    #10 0x562b62f59442 in update_group_walkcb bgpd/bgp_updgrp.c:1721
    #11 0x7fd0a455a7aa in hash_walk lib/hash.c:270
    #12 0x562b62f64a48 in update_group_af_walk bgpd/bgp_updgrp.c:2062
    #13 0x562b62f6508c in update_group_walk bgpd/bgp_updgrp.c:2071
    #14 0x562b62f6520c in update_group_policy_update bgpd/bgp_updgrp.c:1769
    #15 0x562b62f4c2be in bgp_route_map_process_update bgpd/bgp_routemap.c:4501
    #16 0x562b62f4d81a in bgp_route_map_process_update_cb bgpd/bgp_routemap.c:4683
    #17 0x7fd0a45ed7e8 in route_map_walk_update_list lib/routemap.c:870
    #18 0x562b62f337a2 in bgp_route_map_update_timer bgpd/bgp_routemap.c:4695
    #19 0x7fd0a463322a in event_call lib/event.c:1970
    #20 0x7fd0a4576566 in frr_run lib/libfrr.c:1214
    #21 0x562b62dbd8f1 in main bgpd/bgp_main.c:510
    #22 0x7fd0a35b8c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 64 byte(s) in 2 object(s) allocated from:
    #0 0x7fd0a4b95b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x7fd0a459301f in qmalloc lib/memory.c:100
    #2 0x562b630b313f in aspath_make_str_count bgpd/bgp_aspath.c:551
    #3 0x562b630b3ecf in aspath_str_update bgpd/bgp_aspath.c:659
    #4 0x562b630b88b7 in aspath_prepend bgpd/bgp_aspath.c:1484
    #5 0x562b62f484a8 in route_set_aspath_prepend bgpd/bgp_routemap.c:2289
    #6 0x7fd0a45ec39a in route_map_apply_ext lib/routemap.c:2690
    #7 0x562b62efbb1f in subgroup_announce_check bgpd/bgp_route.c:2434
    #8 0x562b62efd4e2 in subgroup_process_announce_selected bgpd/bgp_route.c:2990
    #9 0x562b62f6a829 in subgroup_announce_table bgpd/bgp_updgrp_adv.c:765
    #10 0x562b62f6acbb in subgroup_announce_route bgpd/bgp_updgrp_adv.c:818
    #11 0x562b62f6ae90 in subgroup_coalesce_timer bgpd/bgp_updgrp_adv.c:368
    #12 0x7fd0a463322a in event_call lib/event.c:1970
    #13 0x7fd0a4576566 in frr_run lib/libfrr.c:1214
    #14 0x562b62dbd8f1 in main bgpd/bgp_main.c:510
    #15 0x7fd0a35b8c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 64 byte(s) in 2 object(s) allocated from:
    #0 0x7fd0a4b95b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x7fd0a459301f in qmalloc lib/memory.c:100
    #2 0x562b630b313f in aspath_make_str_count bgpd/bgp_aspath.c:551
    #3 0x562b630b3ecf in aspath_str_update bgpd/bgp_aspath.c:659
    #4 0x562b630b88b7 in aspath_prepend bgpd/bgp_aspath.c:1484
    #5 0x562b62f484a8 in route_set_aspath_prepend bgpd/bgp_routemap.c:2289
    #6 0x7fd0a45ec39a in route_map_apply_ext lib/routemap.c:2690
    #7 0x562b62efbb1f in subgroup_announce_check bgpd/bgp_route.c:2434
    #8 0x562b62efd4e2 in subgroup_process_announce_selected bgpd/bgp_route.c:2990
    #9 0x562b62f6a829 in subgroup_announce_table bgpd/bgp_updgrp_adv.c:765
    #10 0x562b62f6acbb in subgroup_announce_route bgpd/bgp_updgrp_adv.c:818
    #11 0x562b62f5b844 in updgrp_policy_update_walkcb bgpd/bgp_updgrp.c:1685
    #12 0x562b62f59442 in update_group_walkcb bgpd/bgp_updgrp.c:1721
    #13 0x7fd0a455a7aa in hash_walk lib/hash.c:270
    #14 0x562b62f64a48 in update_group_af_walk bgpd/bgp_updgrp.c:2062
    #15 0x562b62f6508c in update_group_walk bgpd/bgp_updgrp.c:2071
    #16 0x562b62f6520c in update_group_policy_update bgpd/bgp_updgrp.c:1769
    #17 0x562b62f4c2be in bgp_route_map_process_update bgpd/bgp_routemap.c:4501
    #18 0x562b62f4d81a in bgp_route_map_process_update_cb bgpd/bgp_routemap.c:4683
    #19 0x7fd0a45ed7e8 in route_map_walk_update_list lib/routemap.c:870
    #20 0x562b62f337a2 in bgp_route_map_update_timer bgpd/bgp_routemap.c:4695
    #21 0x7fd0a463322a in event_call lib/event.c:1970
    #22 0x7fd0a4576566 in frr_run lib/libfrr.c:1214
    #23 0x562b62dbd8f1 in main bgpd/bgp_main.c:510
    #24 0x7fd0a35b8c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 48 byte(s) in 2 object(s) allocated from:
    #0 0x7fd0a4b95d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x7fd0a45932ff in qcalloc lib/memory.c:105
    #2 0x562b630b280d in assegment_new bgpd/bgp_aspath.c:105
    #3 0x562b630b28f7 in assegment_dup bgpd/bgp_aspath.c:145
    #4 0x562b630b29e8 in assegment_dup_all bgpd/bgp_aspath.c:162
    #5 0x562b630b8895 in aspath_prepend bgpd/bgp_aspath.c:1483
    #6 0x562b62f484a8 in route_set_aspath_prepend bgpd/bgp_routemap.c:2289
    #7 0x7fd0a45ec39a in route_map_apply_ext lib/routemap.c:2690
    #8 0x562b62efbb1f in subgroup_announce_check bgpd/bgp_route.c:2434
    #9 0x562b62efd4e2 in subgroup_process_announce_selected bgpd/bgp_route.c:2990
    #10 0x562b62f6a829 in subgroup_announce_table bgpd/bgp_updgrp_adv.c:765
    #11 0x562b62f6acbb in subgroup_announce_route bgpd/bgp_updgrp_adv.c:818
    #12 0x562b62f5b844 in updgrp_policy_update_walkcb bgpd/bgp_updgrp.c:1685
    #13 0x562b62f59442 in update_group_walkcb bgpd/bgp_updgrp.c:1721
    #14 0x7fd0a455a7aa in hash_walk lib/hash.c:270
    #15 0x562b62f64a48 in update_group_af_walk bgpd/bgp_updgrp.c:2062
    #16 0x562b62f6508c in update_group_walk bgpd/bgp_updgrp.c:2071
    #17 0x562b62f6520c in update_group_policy_update bgpd/bgp_updgrp.c:1769
    #18 0x562b62f4c2be in bgp_route_map_process_update bgpd/bgp_routemap.c:4501
    #19 0x562b62f4d81a in bgp_route_map_process_update_cb bgpd/bgp_routemap.c:4683
    #20 0x7fd0a45ed7e8 in route_map_walk_update_list lib/routemap.c:870
    #21 0x562b62f337a2 in bgp_route_map_update_timer bgpd/bgp_routemap.c:4695
    #22 0x7fd0a463322a in event_call lib/event.c:1970
    #23 0x7fd0a4576566 in frr_run lib/libfrr.c:1214
    #24 0x562b62dbd8f1 in main bgpd/bgp_main.c:510
    #25 0x7fd0a35b8c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 48 byte(s) in 2 object(s) allocated from:
    #0 0x7fd0a4b95d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x7fd0a45932ff in qcalloc lib/memory.c:105
    #2 0x562b630b280d in assegment_new bgpd/bgp_aspath.c:105
    #3 0x562b630b28f7 in assegment_dup bgpd/bgp_aspath.c:145
    #4 0x562b630b29e8 in assegment_dup_all bgpd/bgp_aspath.c:162
    #5 0x562b630b8895 in aspath_prepend bgpd/bgp_aspath.c:1483
    #6 0x562b62f484a8 in route_set_aspath_prepend bgpd/bgp_routemap.c:2289
    #7 0x7fd0a45ec39a in route_map_apply_ext lib/routemap.c:2690
    #8 0x562b62efbb1f in subgroup_announce_check bgpd/bgp_route.c:2434
    #9 0x562b62efd4e2 in subgroup_process_announce_selected bgpd/bgp_route.c:2990
    #10 0x562b62f6a829 in subgroup_announce_table bgpd/bgp_updgrp_adv.c:765
    #11 0x562b62f6acbb in subgroup_announce_route bgpd/bgp_updgrp_adv.c:818
    #12 0x562b62f6ae90 in subgroup_coalesce_timer bgpd/bgp_updgrp_adv.c:368
    #13 0x7fd0a463322a in event_call lib/event.c:1970
    #14 0x7fd0a4576566 in frr_run lib/libfrr.c:1214
    #15 0x562b62dbd8f1 in main bgpd/bgp_main.c:510
    #16 0x7fd0a35b8c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 16 byte(s) in 2 object(s) allocated from:
    #0 0x7fd0a4b95b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x7fd0a459301f in qmalloc lib/memory.c:100
    #2 0x562b630b2879 in assegment_data_new bgpd/bgp_aspath.c:83
    #3 0x562b630b2879 in assegment_new bgpd/bgp_aspath.c:108
    #4 0x562b630b28f7 in assegment_dup bgpd/bgp_aspath.c:145
    #5 0x562b630b29e8 in assegment_dup_all bgpd/bgp_aspath.c:162
    #6 0x562b630b8895 in aspath_prepend bgpd/bgp_aspath.c:1483
    #7 0x562b62f484a8 in route_set_aspath_prepend bgpd/bgp_routemap.c:2289
    #8 0x7fd0a45ec39a in route_map_apply_ext lib/routemap.c:2690
    #9 0x562b62efbb1f in subgroup_announce_check bgpd/bgp_route.c:2434
    #10 0x562b62efd4e2 in subgroup_process_announce_selected bgpd/bgp_route.c:2990
    #11 0x562b62f6a829 in subgroup_announce_table bgpd/bgp_updgrp_adv.c:765
    #12 0x562b62f6acbb in subgroup_announce_route bgpd/bgp_updgrp_adv.c:818
    #13 0x562b62f6ae90 in subgroup_coalesce_timer bgpd/bgp_updgrp_adv.c:368
    #14 0x7fd0a463322a in event_call lib/event.c:1970
    #15 0x7fd0a4576566 in frr_run lib/libfrr.c:1214
    #16 0x562b62dbd8f1 in main bgpd/bgp_main.c:510
    #17 0x7fd0a35b8c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 16 byte(s) in 2 object(s) allocated from:
    #0 0x7fd0a4b95b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x7fd0a459301f in qmalloc lib/memory.c:100
    #2 0x562b630b2879 in assegment_data_new bgpd/bgp_aspath.c:83
    #3 0x562b630b2879 in assegment_new bgpd/bgp_aspath.c:108
    #4 0x562b630b28f7 in assegment_dup bgpd/bgp_aspath.c:145
    #5 0x562b630b29e8 in assegment_dup_all bgpd/bgp_aspath.c:162
    #6 0x562b630b8895 in aspath_prepend bgpd/bgp_aspath.c:1483
    #7 0x562b62f484a8 in route_set_aspath_prepend bgpd/bgp_routemap.c:2289
    #8 0x7fd0a45ec39a in route_map_apply_ext lib/routemap.c:2690
    #9 0x562b62efbb1f in subgroup_announce_check bgpd/bgp_route.c:2434
    #10 0x562b62efd4e2 in subgroup_process_announce_selected bgpd/bgp_route.c:2990
    #11 0x562b62f6a829 in subgroup_announce_table bgpd/bgp_updgrp_adv.c:765
    #12 0x562b62f6acbb in subgroup_announce_route bgpd/bgp_updgrp_adv.c:818
    #13 0x562b62f5b844 in updgrp_policy_update_walkcb bgpd/bgp_updgrp.c:1685
    #14 0x562b62f59442 in update_group_walkcb bgpd/bgp_updgrp.c:1721
    #15 0x7fd0a455a7aa in hash_walk lib/hash.c:270
    #16 0x562b62f64a48 in update_group_af_walk bgpd/bgp_updgrp.c:2062
    #17 0x562b62f6508c in update_group_walk bgpd/bgp_updgrp.c:2071
    #18 0x562b62f6520c in update_group_policy_update bgpd/bgp_updgrp.c:1769
    #19 0x562b62f4c2be in bgp_route_map_process_update bgpd/bgp_routemap.c:4501
    #20 0x562b62f4d81a in bgp_route_map_process_update_cb bgpd/bgp_routemap.c:4683
    #21 0x7fd0a45ed7e8 in route_map_walk_update_list lib/routemap.c:870
    #22 0x562b62f337a2 in bgp_route_map_update_timer bgpd/bgp_routemap.c:4695
    #23 0x7fd0a463322a in event_call lib/event.c:1970
    #24 0x7fd0a4576566 in frr_run lib/libfrr.c:1214
    #25 0x562b62dbd8f1 in main bgpd/bgp_main.c:510
    #26 0x7fd0a35b8c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

SUMMARY: AddressSanitizer: 416 byte(s) leaked in 16 allocation(s).
***********************************************************************************

Signed-off-by: ryndia <dindyalsarvesh@gmail.com>
17 months agoMerge pull request #14712 from yenlu-keith/teamd-es-id
Donald Sharp [Tue, 14 Nov 2023 16:20:27 +0000 (11:20 -0500)]
Merge pull request #14712 from yenlu-keith/teamd-es-id

zebra: supports to listen teamd nlmsg as bond type

17 months agoMerge pull request #14725 from donaldsharp/event_io_smoothing
Russ White [Tue, 14 Nov 2023 16:15:54 +0000 (11:15 -0500)]
Merge pull request #14725 from donaldsharp/event_io_smoothing

Event io smoothing

17 months agoMerge pull request #14787 from opensourcerouting/fix/ospf6d_cost_fixup
Russ White [Tue, 14 Nov 2023 13:56:16 +0000 (08:56 -0500)]
Merge pull request #14787 from opensourcerouting/fix/ospf6d_cost_fixup

ospf6d: Let the user override interface cost for a loopback

17 months agoMerge pull request #14135 from squirrelking57/fix_isis_adj_level
Russ White [Tue, 14 Nov 2023 13:49:35 +0000 (08:49 -0500)]
Merge pull request #14135 from squirrelking57/fix_isis_adj_level

isisd:change ngh lvl when int circuit type setted

17 months agoMerge pull request #11800 from mxyns/bmp-locribmon
Russ White [Tue, 14 Nov 2023 13:27:45 +0000 (08:27 -0500)]
Merge pull request #11800 from mxyns/bmp-locribmon

bgpd: BMP Loc-Rib Monitoring (RFC9069) Implementation

17 months agopim6d: Fix memory leaks 14792/head
Mobashshera Rasool [Wed, 8 Nov 2023 05:45:00 +0000 (21:45 -0800)]
pim6d: Fix memory leaks

Problem Statement:
========================
Mentioning few of the leaks here:

=3843268== 6 bytes in 3 blocks are still reachable in loss record 1 of 29
==3843268==    at 0x483C855: malloc (vg_replace_malloc.c:381)
==3843268==    by 0x489ED0E: qmalloc (memory.c:106)
==3843268==    by 0x48DE8DB: redist_add_instance (zclient.c:125)
==3843268==    by 0x48DF561: zclient_init (zclient.c:647)
==3843268==    by 0x14FFA3: pim_zebra_init (pim_zebra.c:527)
==3843268==    by 0x11D021: main (pim6_main.c:178)
==3843268==
==3843268== 24 bytes in 1 blocks are still reachable in loss record 2 of 29
==3843268==    at 0x484147B: calloc (vg_replace_malloc.c:1328)
==3843268==    by 0x489EE03: qcalloc (memory.c:111)
==3843268==    by 0x4878DDE: buffer_new (buffer.c:72)
==3843268==    by 0x48DE7BF: zclient_new (zclient.c:75)
==3843268==    by 0x14FF1D: pim_zebra_init (pim_zebra.c:516)
==3843268==    by 0x11D021: main (pim6_main.c:178)
==3843268==
==3843268== 24 bytes in 1 blocks are still reachable in loss record 3 of 29
==3843268==    at 0x484147B: calloc (vg_replace_malloc.c:1328)
==3843268==    by 0x489EE03: qcalloc (memory.c:111)
==3843268==    by 0x4878DDE: buffer_new (buffer.c:72)
==3843268==    by 0x48DE7BF: zclient_new (zclient.c:75)
==3843268==    by 0x150A3D: zclient_lookup_new (pim_zlookup.c:131)
==3843268==    by 0x11D021: main (pim6_main.c:178)

RCA:
=======================
Memory is allocated when the daemon started but
it is not freed when terminated.

Fix:
=======================
Freeing the memory when daemon goes down.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
17 months agoMerge pull request #14780 from fdumontet6WIND/coverity
Donatas Abraitis [Tue, 14 Nov 2023 07:48:15 +0000 (09:48 +0200)]
Merge pull request #14780 from fdumontet6WIND/coverity

bgpd: fix coverity issue in bgp_snmp_bgp4v2.c

17 months agoMerge pull request #14782 from donaldsharp/pbd
Donatas Abraitis [Tue, 14 Nov 2023 07:06:42 +0000 (09:06 +0200)]
Merge pull request #14782 from donaldsharp/pbd

bgpd: Used %pBD instead of %pRN

17 months agoospf6d: Let the user override interface cost for a loopback 14787/head
Donatas Abraitis [Mon, 13 Nov 2023 19:06:20 +0000 (21:06 +0200)]
ospf6d: Let the user override interface cost for a loopback

Fixes: 80dfa9e012eb ("ospf6d: Set loopback interface cost to 0")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
17 months agoMerge pull request #14781 from donaldsharp/frr_memory_leaks_cleanup
Donatas Abraitis [Mon, 13 Nov 2023 19:17:16 +0000 (21:17 +0200)]
Merge pull request #14781 from donaldsharp/frr_memory_leaks_cleanup

Frr memory leaks cleanup

17 months agobgpd: fix coverity issue in bgp_snmp_bgp4v2.c 14780/head
Francois Dumontet [Mon, 13 Nov 2023 13:44:19 +0000 (14:44 +0100)]
bgpd: fix coverity issue in bgp_snmp_bgp4v2.c

CID 1570969 Overrun
/bgpd/bgp_snmp_bgp4v2.c: 534 in bgp4v2PathAttrLookup()
/bgpd/bgp_snmp_bgp4v2.c: 575 in bgp4v2PathAttrLookup()
/bgpd/bgp_snmp_bgp4v2.c: 514 in bgp4v2PathAttrLookup()

>>>     CID 1570969:    (OVERRUN)
>>>     Overrunning array "bgp->rib" of 4 64-byte elements at element index 4 (byte offset 319) using index "afi" (which evaluates to 4).

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
17 months agobgpd: Used %pBD instead of %pRN 14782/head
Donald Sharp [Mon, 13 Nov 2023 15:26:48 +0000 (10:26 -0500)]
bgpd: Used %pBD instead of %pRN

Let's use the natural data structure in bgp for the prefix display
instead of a bunch of places where we call a translator function.
The %pBD does this and actually ensures data is correct.
Also fix a few spots in bgp_zebra.c where the cast to a NULL
pointer causes the catcher functionality to not work and fix
the resulting crash that resulted.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agoMerge pull request #14768 from idryzhov/mgmtd-base-xpath
Donald Sharp [Mon, 13 Nov 2023 14:19:07 +0000 (09:19 -0500)]
Merge pull request #14768 from idryzhov/mgmtd-base-xpath

lib, mgmtd: respect base xpath in mgmtd

17 months agotests: Remove `log monitor XX` it's not a cli command 14781/head
Donald Sharp [Mon, 13 Nov 2023 14:12:25 +0000 (09:12 -0500)]
tests: Remove `log monitor XX` it's not a cli command

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agozebra: More memory free up on shutdown
Donald Sharp [Mon, 13 Nov 2023 14:07:06 +0000 (09:07 -0500)]
zebra: More memory free up on shutdown

a) nl_batch_tx_buf was not being freed
b) the mlag_fifo was not being freed
c) the vrf->ns_ctxt was not being freed

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agopimd: Free up link list on shutdown
Donald Sharp [Mon, 13 Nov 2023 14:06:10 +0000 (09:06 -0500)]
pimd: Free up link list on shutdown

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agoospf6d: Cleanup memory on shutdown
Donald Sharp [Sun, 12 Nov 2023 03:58:16 +0000 (22:58 -0500)]
ospf6d: Cleanup memory on shutdown

some list data structures were never freed

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agoospfd: Cleanup route-map memory
Donald Sharp [Sun, 12 Nov 2023 03:57:24 +0000 (22:57 -0500)]
ospfd: Cleanup route-map memory

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agoripngd: Cleanup memory on shutdown
Donald Sharp [Sun, 12 Nov 2023 03:56:16 +0000 (22:56 -0500)]
ripngd: Cleanup memory on shutdown

a) routemap data was not being cleaned up
b) ripng data structure was not being cleaned up

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agoripd: Cleanup memory on shutdown
Donald Sharp [Sun, 12 Nov 2023 03:55:00 +0000 (22:55 -0500)]
ripd: Cleanup memory on shutdown

a) routemap data was not being cleaned up
b) rip data structure was not being cleaned up

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agobabeld: Cleanup vrf data structures on shutdown
Donald Sharp [Sun, 12 Nov 2023 03:53:50 +0000 (22:53 -0500)]
babeld: Cleanup vrf data structures on shutdown

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agosharpd: Clean up memory leaks on shutdown
Donald Sharp [Sun, 12 Nov 2023 01:31:55 +0000 (20:31 -0500)]
sharpd: Clean up memory leaks on shutdown

a) The cleanup of zclient on shutdown was not being
done
b) Cleanup vrf shutdown
c) Cleanup some lists

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
sharpd: Cleanup shutdown of vrf and some lists

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agopbrd: Cleanup zclient on shutdown
Donald Sharp [Sun, 12 Nov 2023 01:13:00 +0000 (20:13 -0500)]
pbrd: Cleanup zclient on shutdown

For some reason pbrd had no shutdown code for zclient.
Now it does.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agoMerge pull request #14772 from LabNConsulting/fix-darr-memory-acct
Igor Ryzhov [Mon, 13 Nov 2023 03:47:36 +0000 (05:47 +0200)]
Merge pull request #14772 from LabNConsulting/fix-darr-memory-acct

17 months agoMerge pull request #14771 from LabNConsulting/fix-mgmtd-client-memleaks
Igor Ryzhov [Sun, 12 Nov 2023 18:46:04 +0000 (20:46 +0200)]
Merge pull request #14771 from LabNConsulting/fix-mgmtd-client-memleaks

lib: mgmtd: fix debug cli commands and memleaks

17 months agolib, mgmtd: respect base xpath in mgmtd 14768/head
Igor Ryzhov [Sat, 11 Nov 2023 00:13:17 +0000 (02:13 +0200)]
lib, mgmtd: respect base xpath in mgmtd

`nb_cli_apply_changes` can be called with base xpath which should be
prepended to xpaths of every change in a transaction. This base xpath is
respected by regular northbound CLI but not by mgmtd. This commit fixes
the problem.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
17 months agoMerge pull request #14767 from idryzhov/fix-change-value-free
Donatas Abraitis [Sun, 12 Nov 2023 18:16:19 +0000 (20:16 +0200)]
Merge pull request #14767 from idryzhov/fix-change-value-free

lib: fix possible freeing of libyang data

17 months agoMerge pull request #14774 from idryzhov/bgp-snmp-fix-build
Donatas Abraitis [Sun, 12 Nov 2023 09:06:39 +0000 (10:06 +0100)]
Merge pull request #14774 from idryzhov/bgp-snmp-fix-build

bgpd: fix build error

17 months agomgmtd, lib: remove batch ids from all messages 14657/head
Igor Ryzhov [Fri, 20 Oct 2023 21:51:01 +0000 (00:51 +0300)]
mgmtd, lib: remove batch ids from all messages

Batch IDs are only used to verify that all messages were received and
processed by a backend. It's not necessary to do that as we use reliable
stream transport - messages can't be dropped or received out of order.

This commit also fixes possible race condition that can happen if
one backend process messages slower than other backends.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
17 months agobgpd: fix build error 14774/head
Igor Ryzhov [Sun, 12 Nov 2023 00:57:25 +0000 (02:57 +0200)]
bgpd: fix build error

I recieve the following error with GCC 9.4.0:
```
In file included from /usr/include/string.h:495,
                 from ./lib/zebra.h:23,
                 from bgpd/bgp_snmp_bgp4v2.c:7:
In function ‘memset’,
    inlined from ‘bgp4v2PathAttrLookup’ at bgpd/bgp_snmp_bgp4v2.c:605:3,
    inlined from ‘bgp4v2PathAttrTable’ at bgpd/bgp_snmp_bgp4v2.c:747:9:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:71:10: error: ‘__builtin_memset’ offset [9, 20] from the object at ‘paddr’ is out of the bounds of referenced subobject ‘_v4_addr’ with type ‘struct in_addr’ at offset 4 [-Werror=array-bounds]
   71 |   return __builtin___memset_chk (__dest, __ch, __len, __bos0 (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
17 months agoMerge pull request #14773 from LabNConsulting/fix-log-vty-memleak
Donald Sharp [Sat, 11 Nov 2023 23:25:04 +0000 (18:25 -0500)]
Merge pull request #14773 from LabNConsulting/fix-log-vty-memleak

lib: free the log file resources created at startup and config

17 months agotools: suppress some reachable external lib "leaks" 14771/head
Christian Hopps [Sat, 11 Nov 2023 19:56:26 +0000 (20:56 +0100)]
tools: suppress some reachable external lib "leaks"

- These are just normal reachable allocs from inside external library code;
however, when running valgrind with memleak types "all" in order to find FRR
specific leaks (from memory.h) these are the only other reported leaks. Makes
easier checking and fixing.

Signed-off-by: Christian Hopps <chopps@labn.net>
17 months agolib: free the log file resources created at startup and config 14773/head
Christian Hopps [Sat, 11 Nov 2023 19:31:13 +0000 (20:31 +0100)]
lib: free the log file resources created at startup and config

Signed-off-by: Christian Hopps <chopps@labn.net>
17 months agolib: darr needs to use memory.h for both alloc and free 14772/head
Christian Hopps [Sat, 11 Nov 2023 19:27:22 +0000 (20:27 +0100)]
lib: darr needs to use memory.h for both alloc and free

Was using XREALLOC() and then free(). instant "memleaks".

Signed-off-by: Christian Hopps <chopps@labn.net>