From e81800f6a81a192fb784da45aaecc076628d82df Mon Sep 17 00:00:00 2001 From: Kristof Provost Date: Wed, 13 Dec 2023 13:32:08 +0100 Subject: [PATCH] mcast: fix leaked igmp packets on multicast cleanup When we release a multicast address (e.g. on interface shutdown) we may still have packets queued in inm_scq. We have to free those, or we'll leak memory. Reviewed by: glebius Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D43033 --- sys/netinet/in_mcast.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netinet/in_mcast.c b/sys/netinet/in_mcast.c index f93c4b0dac8..3dc4fa27168 100644 --- a/sys/netinet/in_mcast.c +++ b/sys/netinet/in_mcast.c @@ -1181,6 +1181,7 @@ inm_purge(struct in_multi *inm) free(ims, M_IPMSOURCE); inm->inm_nsrc--; } + mbufq_drain(&inm->inm_scq); } /*