Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Jun 2025 15:48:31 GMT
From:      Zhenlei Huang <zlei@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 8213c07c2058 - main - pfsync: Destroy buckets mutexes on clone destroying interface
Message-ID:  <202506281548.55SFmVIF009576@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by zlei:

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

commit 8213c07c20586a67bc7f7152bd7ff76c02cbc007
Author:     Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2025-06-28 15:46:51 +0000
Commit:     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2025-06-28 15:46:51 +0000

    pfsync: Destroy buckets mutexes on clone destroying interface
    
    So that the associated data with them will be freed.
    
    Reviewed by:    kp
    Fixes:          4fc65bcbe3fb pfsync: Performance improvement
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D51063
---
 sys/netpfil/pf/if_pfsync.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c
index 31b641b43fe3..d5d77fa1ae1d 100644
--- a/sys/netpfil/pf/if_pfsync.c
+++ b/sys/netpfil/pf/if_pfsync.c
@@ -494,6 +494,10 @@ pfsync_clone_destroy(struct ifnet *ifp)
 	mtx_destroy(&sc->sc_mtx);
 	mtx_destroy(&sc->sc_bulk_mtx);
 
+	for (c = 0; c < pfsync_buckets; c++) {
+		b = &sc->sc_buckets[c];
+		mtx_destroy(&b->b_mtx);
+	}
 	free(sc->sc_buckets, M_PFSYNC);
 	free(sc, M_PFSYNC);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202506281548.55SFmVIF009576>