From: Peter Hurley <phurley@charter.net>
To: Johan Hedberg <johan.hedberg@gmail.com>
Cc: linux-bluetooth <linux-bluetooth@vger.kernel.org>,
Peter Hurley <phurley@charter.net>
Subject: [PATCH 1/1] Fixed duplicate attempt from device to connect 'signalling' channel
Date: Wed, 9 Sep 2009 13:25:35 -0400 [thread overview]
Message-ID: <1252517135-7753-1-git-send-email-phurley@charter.net> (raw)
In-Reply-To: <20090908222839.GA25653@jh-x301>
A device may attempt to initiate a duplicate avdtp channel while
a host-initiated channel connection is still pending. This
situation is referred to as 'XCASE connect:connect' in sink.c and
source.c. This fix rejects the device-initiated connection in this
circumstance.
---
audio/avdtp.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/audio/avdtp.c b/audio/avdtp.c
index 131ff4f..6cb9e7d 100644
--- a/audio/avdtp.c
+++ b/audio/avdtp.c
@@ -2119,6 +2119,18 @@ static void avdtp_confirm_cb(GIOChannel *chan, gpointer data)
if (!session)
goto drop;
+ /* This state (ie, session is already *connecting*) happens when the
+ * device initiates a connect (really a config'd L2CAP channel) even
+ * though there is a connect we initiated in progress. In sink.c &
+ * source.c, this state is referred to as XCASE connect:connect.
+ * Abort the device's channel in favor of our own.
+ */
+ if (session->state == AVDTP_SESSION_STATE_CONNECTING) {
+ debug("avdtp_confirm_cb: connect already in progress" \
+ " (XCASE connect:connect)");
+ goto drop;
+ }
+
if (session->pending_open && session->pending_open->open_acp) {
if (!bt_io_accept(chan, avdtp_connect_cb, session, NULL, NULL))
goto drop;
--
1.6.0.4
next prev parent reply other threads:[~2009-09-09 17:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-08 20:57 Fix for audio stream XCASE connect:connect failures Peter Hurley
2009-09-08 22:28 ` Johan Hedberg
2009-09-09 12:32 ` Luiz Augusto von Dentz
2009-09-09 15:49 ` Peter Hurley
2009-09-09 17:25 ` Peter Hurley [this message]
2009-09-09 17:55 ` [PATCH 1/1] Fixed duplicate attempt from device to connect 'signalling' channel Johan Hedberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1252517135-7753-1-git-send-email-phurley@charter.net \
--to=phurley@charter.net \
--cc=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox