From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ] core/device: Fix marking auto-connect flag
Date: Mon, 22 Aug 2016 13:08:38 +0300 [thread overview]
Message-ID: <1471860518-28875-1-git-send-email-luiz.dentz@gmail.com> (raw)
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Device auto-connect shall be set only if the profile is able to accept
incoming connections, this fixes the wrong behavior or connecting LE
with dual mode devices immediatelly after probing service as profiles
may have auto-connect flag for outgoing connection (usually BR/EDR only).
---
src/device.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/device.c b/src/device.c
index c103bb2..14de7e8 100644
--- a/src/device.c
+++ b/src/device.c
@@ -4080,7 +4080,10 @@ static struct btd_service *probe_service(struct btd_device *device,
return NULL;
}
- if (profile->auto_connect)
+ /* Only set auto connect if profile has set the flag and can really
+ * accept connections.
+ */
+ if (profile->auto_connect && profile->accept)
device_set_auto_connect(device, TRUE);
return service;
--
2.7.4
reply other threads:[~2016-08-22 10:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1471860518-28875-1-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).