From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 8/8] AVDTP: Fix responding to ABORT with reject
Date: Fri, 15 Jun 2012 11:04:28 +0300 [thread overview]
Message-ID: <1339747468-31639-8-git-send-email-luiz.dentz@gmail.com> (raw)
In-Reply-To: <1339747468-31639-1-git-send-email-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
ABORT command cannot be rejected
---
audio/a2dp.c | 6 +++---
audio/avdtp.c | 12 +++---------
audio/avdtp.h | 2 +-
3 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/audio/a2dp.c b/audio/a2dp.c
index 094476e..5b1b424 100644
--- a/audio/a2dp.c
+++ b/audio/a2dp.c
@@ -1174,7 +1174,7 @@ static void close_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
g_timeout_add(RECONFIGURE_TIMEOUT, a2dp_reconfigure, setup);
}
-static gboolean abort_ind(struct avdtp *session, struct avdtp_local_sep *sep,
+static void abort_ind(struct avdtp *session, struct avdtp_local_sep *sep,
struct avdtp_stream *stream, uint8_t *err,
void *user_data)
{
@@ -1190,13 +1190,13 @@ static gboolean abort_ind(struct avdtp *session, struct avdtp_local_sep *sep,
setup = find_setup_by_session(session);
if (!setup)
- return TRUE;
+ return;
finalize_setup_errno(setup, -ECONNRESET, finalize_suspend,
finalize_resume,
finalize_config);
- return TRUE;
+ return;
}
static void abort_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
diff --git a/audio/avdtp.c b/audio/avdtp.c
index 61f5f94..1366bf1 100644
--- a/audio/avdtp.c
+++ b/audio/avdtp.c
@@ -1954,11 +1954,9 @@ static gboolean avdtp_abort_cmd(struct avdtp *session, uint8_t transaction,
if (!sep || !sep->stream)
return TRUE;
- if (sep->ind && sep->ind->abort) {
- if (!sep->ind->abort(session, sep, sep->stream, &err,
- sep->user_data))
- goto failed;
- }
+ if (sep->ind && sep->ind->abort)
+ sep->ind->abort(session, sep, sep->stream, &err,
+ sep->user_data);
avdtp_check_collision(session, AVDTP_ABORT, sep->stream);
@@ -1968,10 +1966,6 @@ static gboolean avdtp_abort_cmd(struct avdtp *session, uint8_t transaction,
avdtp_sep_set_state(session, sep, AVDTP_STATE_ABORTING);
return ret;
-
-failed:
- return avdtp_send(session, transaction, AVDTP_MSG_TYPE_REJECT,
- AVDTP_ABORT, &err, sizeof(err));
}
static gboolean avdtp_secctl_cmd(struct avdtp *session, uint8_t transaction,
diff --git a/audio/avdtp.h b/audio/avdtp.h
index 1979694..8acf302 100644
--- a/audio/avdtp.h
+++ b/audio/avdtp.h
@@ -199,7 +199,7 @@ struct avdtp_sep_ind {
gboolean (*close) (struct avdtp *session, struct avdtp_local_sep *sep,
struct avdtp_stream *stream, uint8_t *err,
void *user_data);
- gboolean (*abort) (struct avdtp *session, struct avdtp_local_sep *sep,
+ void (*abort) (struct avdtp *session, struct avdtp_local_sep *sep,
struct avdtp_stream *stream, uint8_t *err,
void *user_data);
gboolean (*reconfigure) (struct avdtp *session,
--
1.7.10.2
prev parent reply other threads:[~2012-06-15 8:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-15 8:04 [PATCH BlueZ 1/8] audio: Add handling of avdtp command collision Luiz Augusto von Dentz
2012-06-15 8:04 ` [PATCH BlueZ 2/8] audio: Fix handling of a2dp suspend indication Luiz Augusto von Dentz
2012-06-15 9:30 ` Johan Hedberg
2012-06-15 12:41 ` Luiz Augusto von Dentz
2012-06-15 8:04 ` [PATCH BlueZ 3/8] audio: Fix handling of a2dp open indication Luiz Augusto von Dentz
2012-06-15 8:04 ` [PATCH BlueZ 4/8] audio: Fix handling of a2dp start indication Luiz Augusto von Dentz
2012-06-15 9:31 ` Johan Hedberg
2012-06-15 8:04 ` [PATCH BlueZ 5/8] audio: Fix handling of a2dp abort indication Luiz Augusto von Dentz
2012-06-15 8:04 ` [PATCH BlueZ 6/8] audio: Wait remote side to send AVDTP_START when acting as acceptor Luiz Augusto von Dentz
2012-06-15 8:04 ` [PATCH BlueZ 7/8] AVDTP: Do not respond ABORT command with invalid id Luiz Augusto von Dentz
2012-06-15 8:04 ` Luiz Augusto von Dentz [this message]
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=1339747468-31639-8-git-send-email-luiz.dentz@gmail.com \
--to=luiz.dentz@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;
as well as URLs for NNTP newsgroup(s).