git: c196e43243b8 - main - Revert "mcast: fix memory leak in imf_purge()"

From: Kristof Provost <kp_at_FreeBSD.org>
Date: Thu, 14 Dec 2023 22:00:00 UTC
The branch main has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=c196e43243b83840cc9f3d1dadc7dacb3b0f556f

commit c196e43243b83840cc9f3d1dadc7dacb3b0f556f
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2023-12-12 18:20:03 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2023-12-14 21:05:34 +0000

    Revert "mcast: fix memory leak in imf_purge()"
    
    This reverts commit fa03d37432caf17d56a931a9e6f5d9b06f102c5b.
    
    This commit caused us to not send IGMP leave messages if the inpcb went
    away. In other words: we freed pending packets whenever the socket
    closed rather than when the interface (or address) goes away.
    
    Reviewed by:    glebius
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    Differential Revision:  https://reviews.freebsd.org/D43032
---
 sys/netinet/in_mcast.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/sys/netinet/in_mcast.c b/sys/netinet/in_mcast.c
index ee707414dc42..cae15bc4108a 100644
--- a/sys/netinet/in_mcast.c
+++ b/sys/netinet/in_mcast.c
@@ -914,8 +914,6 @@ imf_purge(struct in_mfilter *imf)
 	imf->imf_st[0] = imf->imf_st[1] = MCAST_UNDEFINED;
 	KASSERT(RB_EMPTY(&imf->imf_sources),
 	    ("%s: imf_sources not empty", __func__));
-	if (imf->imf_inm != NULL)
-		mbufq_drain(&imf->imf_inm->inm_scq);
 }
 
 /*