git: 8213c07c2058 - main - pfsync: Destroy buckets mutexes on clone destroying interface
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 28 Jun 2025 15:48:31 UTC
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);