summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authortuexen <tuexen@FreeBSD.org>2013-11-30 12:51:19 +0000
committertuexen <tuexen@FreeBSD.org>2013-11-30 12:51:19 +0000
commit38fb2a0d9d2cd0712ac376fa3c1edfd6effb5900 (patch)
tree993d5ea8bc30bfb0388d1383124ef88960fe6a9b /sys/netinet
parent705a4d27a5a1df7ff1d5fea375d04df72bae874a (diff)
downloadFreeBSD-src-38fb2a0d9d2cd0712ac376fa3c1edfd6effb5900.zip
FreeBSD-src-38fb2a0d9d2cd0712ac376fa3c1edfd6effb5900.tar.gz
In
http://svnweb.freebsd.org/changeset/base/258221 I introduced a bug which initialized global locks whenever the SCTP stack initialized. This was fixed in http://svnweb.freebsd.org/changeset/base/258574 by rodrigc@. He just initialized the locks for the default vnet. This fix reverts to the old behaviour before r258221, which explicitly makes sure it is only called once, because this works also on other platforms. MFC after: 3 days X-MFC with: r258574.
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/sctp_bsd_addr.c3
-rw-r--r--sys/netinet/sctp_pcb.c8
2 files changed, 3 insertions, 8 deletions
diff --git a/sys/netinet/sctp_bsd_addr.c b/sys/netinet/sctp_bsd_addr.c
index 1ae8ba6..520670f 100644
--- a/sys/netinet/sctp_bsd_addr.c
+++ b/sys/netinet/sctp_bsd_addr.c
@@ -100,6 +100,9 @@ sctp_startup_iterator(void)
/* You only get one */
return;
}
+ /* Initialize global locks here, thus only once. */
+ SCTP_ITERATOR_LOCK_INIT();
+ SCTP_IPI_ITERATOR_WQ_INIT();
TAILQ_INIT(&sctp_it_ctl.iteratorhead);
kproc_create(sctp_iterator_thread,
(void *)NULL,
diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c
index c3439be..88dd145 100644
--- a/sys/netinet/sctp_pcb.c
+++ b/sys/netinet/sctp_pcb.c
@@ -5864,14 +5864,6 @@ sctp_pcb_init()
for (i = 0; i < SCTP_STACK_VTAG_HASH_SIZE; i++) {
LIST_INIT(&SCTP_BASE_INFO(vtag_timewait)[i]);
}
- /*
- * Only initialize non-VNET global mutexes for the
- * default instance.
- */
- if (IS_DEFAULT_VNET(curvnet)) {
- SCTP_ITERATOR_LOCK_INIT();
- SCTP_IPI_ITERATOR_WQ_INIT();
- }
sctp_startup_iterator();
#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP)
OpenPOWER on IntegriCloud