mirror of
				https://git.proxmox.com/git/mirror_frr
				synced 2025-10-31 13:03:19 +00:00 
			
		
		
		
	|  24379f0bb2 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> | ||
|---|---|---|
| .. | ||
| .gitignore | ||
| AUTHORS | ||
| CAVEATS | ||
| COMMANDS | ||
| DEBUG | ||
| LINUX_KERNEL_MROUTE_MFC | ||
| Makefile | ||
| mtracebis_netlink.c | ||
| mtracebis_netlink.h | ||
| mtracebis_routeget.c | ||
| mtracebis_routeget.h | ||
| mtracebis.c | ||
| pim6_cmd.c | ||
| pim6_cmd.h | ||
| pim6_main.c | ||
| pim6_mld_protocol.h | ||
| pim6_mld.c | ||
| pim6_mld.h | ||
| pim_addr.c | ||
| pim_addr.h | ||
| pim_assert.c | ||
| pim_assert.h | ||
| pim_bfd.c | ||
| pim_bfd.h | ||
| pim_bsm.c | ||
| pim_bsm.h | ||
| pim_cmd_common.c | ||
| pim_cmd_common.h | ||
| pim_cmd.c | ||
| pim_cmd.h | ||
| pim_errors.c | ||
| pim_errors.h | ||
| pim_hello.c | ||
| pim_hello.h | ||
| pim_iface.c | ||
| pim_iface.h | ||
| pim_ifchannel.c | ||
| pim_ifchannel.h | ||
| pim_igmp_join.h | ||
| pim_igmp_mtrace.c | ||
| pim_igmp_mtrace.h | ||
| pim_igmp_stats.c | ||
| pim_igmp_stats.h | ||
| pim_igmp.c | ||
| pim_igmp.h | ||
| pim_igmpv2.c | ||
| pim_igmpv2.h | ||
| pim_igmpv3.c | ||
| pim_igmpv3.h | ||
| pim_instance.c | ||
| pim_instance.h | ||
| pim_int.c | ||
| pim_int.h | ||
| pim_join.c | ||
| pim_join.h | ||
| pim_jp_agg.c | ||
| pim_jp_agg.h | ||
| pim_macro.c | ||
| pim_macro.h | ||
| pim_main.c | ||
| pim_memory.c | ||
| pim_memory.h | ||
| pim_mlag.c | ||
| pim_mlag.h | ||
| pim_mroute.c | ||
| pim_mroute.h | ||
| pim_msdp_packet.c | ||
| pim_msdp_packet.h | ||
| pim_msdp_socket.c | ||
| pim_msdp_socket.h | ||
| pim_msdp.c | ||
| pim_msdp.h | ||
| pim_msg.c | ||
| pim_msg.h | ||
| pim_nb_config.c | ||
| pim_nb.c | ||
| pim_nb.h | ||
| pim_neighbor.c | ||
| pim_neighbor.h | ||
| pim_nht.c | ||
| pim_nht.h | ||
| pim_oil.c | ||
| pim_oil.h | ||
| pim_pim.c | ||
| pim_pim.h | ||
| pim_register.c | ||
| pim_register.h | ||
| pim_routemap.c | ||
| pim_rp.c | ||
| pim_rp.h | ||
| pim_rpf.c | ||
| pim_rpf.h | ||
| pim_signals.c | ||
| pim_signals.h | ||
| pim_sock.c | ||
| pim_sock.h | ||
| pim_ssm.c | ||
| pim_ssm.h | ||
| pim_ssmpingd.c | ||
| pim_ssmpingd.h | ||
| pim_static.c | ||
| pim_static.h | ||
| pim_str.c | ||
| pim_str.h | ||
| pim_tib.c | ||
| pim_tib.h | ||
| pim_time.c | ||
| pim_time.h | ||
| pim_tlv.c | ||
| pim_tlv.h | ||
| pim_upstream.c | ||
| pim_upstream.h | ||
| pim_util.c | ||
| pim_util.h | ||
| pim_vty.c | ||
| pim_vty.h | ||
| pim_vxlan_instance.h | ||
| pim_vxlan.c | ||
| pim_vxlan.h | ||
| pim_zebra.c | ||
| pim_zebra.h | ||
| pim_zlookup.c | ||
| pim_zlookup.h | ||
| pim_zpthread.c | ||
| pimd.c | ||
| pimd.h | ||
| README | ||
| subdir.am | ||
| test_igmpv3_join.c | ||
| TODO | ||
| TROUBLESHOOTING | ||
INTRODUCTION
        qpimd aims to implement a PIM (Protocol Independent Multicast)
	daemon for the FRR Routing Suite.
	qpimd implements PIM-SM (Sparse Mode) of RFC 4601.
        Additionally MSDP has been implemented.
	In order to deliver end-to-end multicast routing control
	plane, qpimd includes the router-side of IGMPv[2|3] (RFC 3376).
LICENSE
        qpimd - pimd for FRR
        Copyright (C) 2008 Everton da Silva Marques
        qpimd is free software; you can redistribute it and/or modify
        it under the terms of the GNU General Public License as
        published by the Free Software Foundation; either version 2,
        or (at your option) any later version.
        qpimd is distributed in the hope that it will be useful, but
        WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.
        You should have received a copy of the GNU General Public
        License along with qpimd; see the file COPYING.  If not, write
        to the Free Software Foundation, Inc., 59 Temple Place - Suite
        330, Boston, MA 02111-1307, USA.
HOME SITE
        qpimd lives at:
        https://github.com/frrouting/frr
PLATFORMS
	qpimd has been tested with Debian Jessie.
REQUIREMENTS
	qpimd requires FRR (2.0 or higher)
CONFIGURATION COMMANDS
	See available commands in the file pimd/COMMANDS.
KNOWN CAVEATS
	See list of known caveats in the file pimd/CAVEATS.
SUPPORT
	Please post comments, questions, patches, bug reports at the
	support site:
        https://frrouting.org/frr
RELATED WORK
	igmprt:	An IGMPv3-router implementation
	- http://www.loria.fr/~lahmadi/igmpv3-router.html
	USC pimd: PIMv2-SM daemon
	- http://netweb.usc.edu/pim/pimd (URL broken in 2008-12-23)
	- http://packages.debian.org/source/sid/pimd (from Debian)
	troglobit pimd: This is the original USC pimd from
	http://netweb.usc.edu/pim/. In January 16, 2010 it was revived
	with the intention to collect patches floating around in
	Debian, Gentoo, Lintrack and other distribution repositories
	and to provide a central point of collaboration.
	- http://github.com/troglobit/pimd
	zpimd: zpimd is not dependent of zebra or any other routing daemon
	- ftp://robur.slu.se/pub/Routing/Zebra
	- http://sunsite2.icm.edu.pl/pub/unix/routing/zpimd
	mrd6: an IPv6 Multicast Router for Linux systems
	- http://fivebits.net/proj/mrd6/
	MBGP: Implementation of RFC 2858 for Quagga
	- git://git.coplanar.net/~balajig/quagga
	- http://www.gossamer-threads.com/lists/quagga/dev/18000
REFERENCES
	IANA Protocol Independent Multicast (PIM) Parameters
	http://www.iana.org/assignments/pim-parameters/pim-parameters.txt
	Address Family Numbers
	http://www.iana.org/assignments/address-family-numbers
                              -- END --