aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Luis Duran <jlduran@FreeBSD.org>2024-11-12 18:51:45 +0000
committerJose Luis Duran <jlduran@FreeBSD.org>2024-11-12 18:53:39 +0000
commita0618fbe19dfedcdf01b4c232fe6669ae19505c4 (patch)
treede976871bfbef9cd7cd435751c81f558a5519c00
parent93f7a3023c3147d42dbe3dab58a5a70779587ea5 (diff)
Revert "ipfilter: Avoid stopping with a lock held"
The timeout function still tries to acquire the rwlock, and now it deadlocks, since the callout framework will have already acquired it. This reverts commit 1fa6daaafd74c1a457dcfe26e0a5943b5441dc9d. PR: 282478 Reported by: markj Approved by: emaste (mentor)
-rw-r--r--sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c
index 23514907f86e..84fac0205ffc 100644
--- a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c
+++ b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c
@@ -178,7 +178,7 @@ ipf_timer_func(void *arg)
ipf_slowtimer(softc);
if (softc->ipf_running == -1 || softc->ipf_running == 1) {
- callout_init_rw(&softc->ipf_slow_ch, &softc->ipf_global.ipf_lk, CALLOUT_SHAREDLOCK);
+ callout_init(&softc->ipf_slow_ch, 1);
callout_reset(&softc->ipf_slow_ch,
(hz / IPF_HZ_DIVIDE) * IPF_HZ_MULT,
ipf_timer_func, softc);
@@ -218,7 +218,7 @@ ipfattach(ipf_main_softc_t *softc)
softc->ipf_slow_ch = timeout(ipf_timer_func, softc,
(hz / IPF_HZ_DIVIDE) * IPF_HZ_MULT);
#endif
- callout_init_rw(&softc->ipf_slow_ch, &softc->ipf_global.ipf_lk, CALLOUT_SHAREDLOCK);
+ callout_init(&softc->ipf_slow_ch, 1);
callout_reset(&softc->ipf_slow_ch, (hz / IPF_HZ_DIVIDE) * IPF_HZ_MULT,
ipf_timer_func, softc);
return (0);