From: Andrei Emeltchenko <andrei.emeltchenko.news@gmail.com>
To: Mat Martineau <mathewm@codeaurora.org>
Cc: linux-bluetooth@vger.kernel.org, gustavo@padovan.org,
marcel@holtmann.org, pkrystad@codeaurora.org
Subject: Re: [PATCHv2] Bluetooth: Send a configuration request after security confirmation
Date: Wed, 23 May 2012 11:20:15 +0300 [thread overview]
Message-ID: <20120523082013.GB32022@aemeltch-MOBL1> (raw)
In-Reply-To: <1337720145-8019-1-git-send-email-mathewm@codeaurora.org>
Hi Mat,
On Tue, May 22, 2012 at 01:55:45PM -0700, Mat Martineau wrote:
> Sometimes an ACL link must be raised to a higher security level after
> an L2CAP connection is requested, but before a connection response is
> sent. In this case, a connection response sent by L2CAP was not
> immediately followed by a configuration request. Other code paths do
> send this configuration request right away. It was possible for the
> connection to time out while L2CAP waited for the remote device (like
> PTS) to trigger the configuration process.
>
> This change immediately sends a configuration request after a connect
> response rather than waiting for a configuration request from the
> remote device. It fixes connection stalls in a variety of PTS test
> cases.
>
> Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
> ---
> net/bluetooth/l2cap_core.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> index b644f40..14c27f4 100644
> --- a/net/bluetooth/l2cap_core.c
> +++ b/net/bluetooth/l2cap_core.c
> @@ -5519,6 +5519,17 @@ int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
> rsp.status = cpu_to_le16(stat);
> l2cap_send_cmd(conn, chan->ident, L2CAP_CONN_RSP,
> sizeof(rsp), &rsp);
> +
> + if (!test_bit(CONF_REQ_SENT, &chan->conf_state) &&
> + res == L2CAP_CR_SUCCESS) {
This looks more readable but I think we used to have constructions like
!status so this would translate to !res
Best regards
Andrei Emeltchenko
prev parent reply other threads:[~2012-05-23 8:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-22 20:55 [PATCHv2] Bluetooth: Send a configuration request after security confirmation Mat Martineau
2012-05-23 3:12 ` Marcel Holtmann
2012-05-23 21:59 ` [PATCHv3] " Mat Martineau
2012-05-24 0:28 ` Marcel Holtmann
2012-05-24 0:33 ` Gustavo Padovan
2012-05-23 8:20 ` Andrei Emeltchenko [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=20120523082013.GB32022@aemeltch-MOBL1 \
--to=andrei.emeltchenko.news@gmail.com \
--cc=gustavo@padovan.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=marcel@holtmann.org \
--cc=mathewm@codeaurora.org \
--cc=pkrystad@codeaurora.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