summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ipfw
diff options
context:
space:
mode:
authorluigi <luigi@FreeBSD.org>2010-03-04 16:53:38 +0000
committerluigi <luigi@FreeBSD.org>2010-03-04 16:53:38 +0000
commit70c24f778e7acb9d4246a9d4c5e1f0dc74a66b8a (patch)
tree626fa84e87bdcc0eb848eaeeef61330e6bbf66ed /sys/netinet/ipfw
parente983b27b49c31eacb1450f8e1df5c27ad1d6b669 (diff)
downloadFreeBSD-src-70c24f778e7acb9d4246a9d4c5e1f0dc74a66b8a.zip
FreeBSD-src-70c24f778e7acb9d4246a9d4c5e1f0dc74a66b8a.tar.gz
use callout_drain() (outside the lock) when unloading the module.
This prevents a potential deadlock. Submitted by: Francesco Magno
Diffstat (limited to 'sys/netinet/ipfw')
-rw-r--r--sys/netinet/ipfw/ip_dummynet.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/netinet/ipfw/ip_dummynet.c b/sys/netinet/ipfw/ip_dummynet.c
index 20b776f..d49872c 100644
--- a/sys/netinet/ipfw/ip_dummynet.c
+++ b/sys/netinet/ipfw/ip_dummynet.c
@@ -1690,8 +1690,8 @@ compute_space(struct dn_id *cmd, int *to_copy)
* link, scheduler template, flowset
* integrated in scheduler and header
* for flowset list
- * (NSI)*(dn_flow + dn_queue) all scheduler instance + one
- * queue per instance
+ * (NSI)*(dn_flow) all scheduler instance (includes
+ * the queue instance)
* - ipfw sched show
* (NP/2)*(dn_link + dn_sch + dn_id + dn_fs) only half scheduler
* link, scheduler template, flowset
@@ -1708,11 +1708,13 @@ compute_space(struct dn_id *cmd, int *to_copy)
default:
return -1;
/* XXX where do LINK and SCH differ ? */
+ /* 'ipfw sched show' could list all queues associated to
+ * a scheduler. This feature for now is disabled
+ */
case DN_LINK: /* pipe show */
x = DN_C_LINK | DN_C_SCH | DN_C_FLOW;
need += dn_cfg.schk_count *
(sizeof(struct dn_fs) + profile_size) / 2;
- need += dn_cfg.si_count * sizeof(struct dn_queue);
need += dn_cfg.fsk_count * sizeof(uint32_t);
break;
case DN_SCH: /* sched show */
@@ -2072,11 +2074,12 @@ ip_dn_init(void)
static void
ip_dn_destroy(void)
{
+ callout_drain(&dn_timeout);
+
DN_BH_WLOCK();
ip_dn_ctl_ptr = NULL;
ip_dn_io_ptr = NULL;
- callout_stop(&dn_timeout);
dummynet_flush();
DN_BH_WUNLOCK();
taskqueue_drain(dn_tq, &dn_task);
OpenPOWER on IntegriCloud