From fd184248cfd1cb0e05b1f257a20188c11ed3a99f Mon Sep 17 00:00:00 2001 From: Marcin Kraglak Date: Wed, 11 Mar 2015 19:11:02 +0100 Subject: [PATCH] audio/avctp: Cancel outgoing connection in case of conflict According to AVRCP Spec 1.5 AVCTP channel should be closed if both sides try establish connection at the same time. --- profiles/audio/avctp.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/profiles/audio/avctp.c b/profiles/audio/avctp.c index 14b02662a..22bf35b06 100644 --- a/profiles/audio/avctp.c +++ b/profiles/audio/avctp.c @@ -1351,6 +1351,13 @@ static void avctp_control_confirm(struct avctp *session, GIOChannel *chan, if (session->control != NULL) { error("Control: Refusing unexpected connect"); g_io_channel_shutdown(chan, TRUE, NULL); + + /* + * Close AVCTP channel if remote tried connect + * at the same time + * AVRCP SPEC V1.5 4.1.1 Connection Establishment + */ + avctp_set_state(session, AVCTP_STATE_DISCONNECTED, -EAGAIN); return; } -- 2.47.3