Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F158885541
D3855.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D3855.diff
View Options
Index: head/sys/netpfil/ipfw/ip_dn_io.c
===================================================================
--- head/sys/netpfil/ipfw/ip_dn_io.c
+++ head/sys/netpfil/ipfw/ip_dn_io.c
@@ -711,8 +711,8 @@
dn_drain_queue();
}
- DN_BH_WUNLOCK();
dn_reschedule();
+ DN_BH_WUNLOCK();
if (q.head != NULL)
dummynet_send(q.head);
CURVNET_RESTORE();
Index: head/sys/netpfil/ipfw/ip_dummynet.c
===================================================================
--- head/sys/netpfil/ipfw/ip_dummynet.c
+++ head/sys/netpfil/ipfw/ip_dummynet.c
@@ -75,6 +75,7 @@
/*---- callout hooks. ----*/
static struct callout dn_timeout;
+static int dn_gone;
static struct task dn_task;
static struct taskqueue *dn_tq = NULL;
@@ -90,6 +91,8 @@
dn_reschedule(void)
{
+ if (dn_gone != 0)
+ return;
callout_reset_sbt(&dn_timeout, tick_sbt, 0, dummynet, NULL,
C_HARDCLOCK | C_DIRECT_EXEC);
}
@@ -2179,9 +2182,11 @@
static void
ip_dn_destroy(int last)
{
- callout_drain(&dn_timeout);
-
DN_BH_WLOCK();
+ /* ensure no more callouts are started */
+ dn_gone = 1;
+
+ /* check for last */
if (last) {
ND("removing last instance\n");
ip_dn_ctl_ptr = NULL;
@@ -2190,6 +2195,8 @@
dummynet_flush();
DN_BH_WUNLOCK();
+
+ callout_drain(&dn_timeout);
taskqueue_drain(dn_tq, &dn_task);
taskqueue_free(dn_tq);
Index: head/sys/netpfil/ipfw/ip_fw2.c
===================================================================
--- head/sys/netpfil/ipfw/ip_fw2.c
+++ head/sys/netpfil/ipfw/ip_fw2.c
@@ -2814,11 +2814,10 @@
IPFW_UH_WLOCK(chain);
IPFW_UH_WUNLOCK(chain);
- IPFW_UH_WLOCK(chain);
- IPFW_WLOCK(chain);
ipfw_dyn_uninit(0); /* run the callout_drain */
- IPFW_WUNLOCK(chain);
+
+ IPFW_UH_WLOCK(chain);
reap = NULL;
IPFW_WLOCK(chain);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jun 8, 7:48 AM (12 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33808171
Default Alt Text
D3855.diff (1 KB)
Attached To
Mode
D3855: Properly drain callouts in the IPFW subsystem
Attached
Detach File
Event Timeline
Log In to Comment