From: "Gustavo F. Padovan" <padovan@profusion.mobi>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] bluetooth: fix shutdown on SCO sockets
Date: Fri, 15 Apr 2011 15:58:45 -0300 [thread overview]
Message-ID: <20110415185845.GB2359@joana> (raw)
In-Reply-To: <1302271841-12127-1-git-send-email-luiz.dentz@gmail.com>
Hi Luiz,
* Luiz Augusto von Dentz <luiz.dentz@gmail.com> [2011-04-08 17:10:41 +0300]:
> From: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>
>
> shutdown should wait for SCO link to be properly disconnected before
> detroying the socket, otherwise an application using the socket may
> assume link is properly disconnected before it really happens which
> can be a problem when e.g synchronizing profile switch.
>
> Signed-off-by: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>
I applied it, but in bluetooth-next. Let's see its behaviour there and if no
problems show up we can move it to bluetooth-2.6
> ---
> net/bluetooth/sco.c | 9 +++++++++
> 1 files changed, 9 insertions(+), 0 deletions(-)
>
> diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
> index 42fdffd..94954c7 100644
> --- a/net/bluetooth/sco.c
> +++ b/net/bluetooth/sco.c
> @@ -369,6 +369,15 @@ static void __sco_sock_close(struct sock *sk)
>
> case BT_CONNECTED:
> case BT_CONFIG:
> + if (sco_pi(sk)->conn) {
> + sk->sk_state = BT_DISCONN;
> + sco_sock_set_timer(sk, SCO_DISCONN_TIMEOUT);
> + hci_conn_put(sco_pi(sk)->conn->hcon);
> + sco_pi(sk)->conn = NULL;
> + } else
> + sco_chan_del(sk, ECONNRESET);
> + break;
> +
> case BT_CONNECT:
> case BT_DISCONN:
> sco_chan_del(sk, ECONNRESET);
> --
> 1.7.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Gustavo F. Padovan
http://profusion.mobi
next prev parent reply other threads:[~2011-04-15 18:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-08 14:10 [PATCH] bluetooth: fix shutdown on SCO sockets Luiz Augusto von Dentz
2011-04-15 18:58 ` Gustavo F. Padovan [this message]
2011-04-17 17:26 ` Luiz Augusto von Dentz
2011-04-18 17:56 ` Gustavo F. Padovan
2011-05-05 14:50 ` Luiz Augusto von Dentz
2011-05-11 17:09 ` Gustavo F. Padovan
2011-05-11 20:49 ` Luiz Augusto von Dentz
2011-05-11 20:52 ` Gustavo F. Padovan
-- strict thread matches above, loose matches on Subject: below --
2011-05-12 8:13 Luiz Augusto von Dentz
2011-05-19 22:27 ` Gustavo F. Padovan
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=20110415185845.GB2359@joana \
--to=padovan@profusion.mobi \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
/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).