From: "Gustavo F. Padovan" <padovan@profusion.mobi>
To: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Cc: linux-bluetooth@vger.kernel.org, Ville Tervo <ville.tervo@nokia.com>
Subject: Re: [RFC 06/20] Bluetooth: Do not send disconn comand over LE links
Date: Tue, 23 Nov 2010 20:48:39 -0200 [thread overview]
Message-ID: <20101123224839.GA11860@vigoh> (raw)
In-Reply-To: <1290524796-32246-7-git-send-email-vinicius.gomes@openbossa.org>
* Vinicius Costa Gomes <vinicius.gomes@openbossa.org> [2010-11-23 12:06:22 -0300]:
> From: Ville Tervo <ville.tervo@nokia.com>
>
> l2cap over LE links can be disconnected without sending
> disconnect command first.
>
> Signed-off-by: Ville Tervo <ville.tervo@nokia.com>
> ---
> net/bluetooth/l2cap.c | 15 ++++++++++-----
> 1 files changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
> index 0b583c4..5894662 100644
> --- a/net/bluetooth/l2cap.c
> +++ b/net/bluetooth/l2cap.c
> @@ -873,6 +873,8 @@ static void l2cap_sock_kill(struct sock *sk)
>
> static void __l2cap_sock_close(struct sock *sk, int reason)
> {
> + struct l2cap_conn *conn;
> +
> BT_DBG("sk %p state %d socket %p", sk, sk->sk_state, sk->sk_socket);
>
> switch (sk->sk_state) {
> @@ -882,8 +884,10 @@ static void __l2cap_sock_close(struct sock *sk, int reason)
>
> case BT_CONNECTED:
> case BT_CONFIG:
> - if (sk->sk_type == SOCK_SEQPACKET ||
> - sk->sk_type == SOCK_STREAM) {
> + conn = l2cap_pi(sk)->conn;
> + if ((sk->sk_type == SOCK_SEQPACKET ||
> + sk->sk_type == SOCK_STREAM) &&
> + conn->hcon->type != LE_LINK) {
Makes more senses check for conn->hcon->type == ACL_LINK.
> struct l2cap_conn *conn = l2cap_pi(sk)->conn;
>
> l2cap_sock_set_timer(sk, sk->sk_sndtimeo);
> @@ -893,9 +897,10 @@ static void __l2cap_sock_close(struct sock *sk, int reason)
> break;
>
> case BT_CONNECT2:
> - if (sk->sk_type == SOCK_SEQPACKET ||
> - sk->sk_type == SOCK_STREAM) {
> - struct l2cap_conn *conn = l2cap_pi(sk)->conn;
> + conn = l2cap_pi(sk)->conn;
> + if ((sk->sk_type == SOCK_SEQPACKET ||
> + sk->sk_type == SOCK_STREAM) &&
> + conn->hcon->type != LE_LINK) {
Same here.
--
Gustavo F. Padovan
http://profusion.mobi
next prev parent reply other threads:[~2010-11-23 22:48 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-23 15:06 [RFC 00/20] Simple SMP Just Works implementation Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 01/20] Bluetooth: Add low energy commands and events Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 02/20] Bluetooth: Add LE connect support Vinicius Costa Gomes
2010-11-23 17:57 ` Gustavo F. Padovan
2010-11-24 5:03 ` Ville Tervo
2010-11-23 15:06 ` [RFC 03/20] Bluetooth: Use LE buffers for LE traffic Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 04/20] Bluetooth: Add LE connection support to L2CAP Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 05/20] Bluetooth: Add server socket support for LE connection Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 06/20] Bluetooth: Do not send disconn comand over LE links Vinicius Costa Gomes
2010-11-23 22:48 ` Gustavo F. Padovan [this message]
2010-11-24 5:05 ` Ville Tervo
2010-11-23 15:06 ` [RFC 07/20] Bluetooth: Fix initiated LE connections Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 08/20] Bluetooth: Treat LE and ACL links separately on timeout Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 09/20] Bluetooth: Fix locking balance in l2cap_le_conn_ready Vinicius Costa Gomes
2010-11-23 22:52 ` Gustavo F. Padovan
2010-11-23 15:06 ` [RFC 10/20] Bluetooth: Add server socket support for LE connection Vinicius Costa Gomes
2010-11-23 22:54 ` Gustavo F. Padovan
2010-11-23 23:04 ` Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 11/20] Bluetooth: Add SMP command structures Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 12/20] Bluetooth: fix receiving L2CAP packets over LE Vinicius Costa Gomes
2010-11-23 22:55 ` Gustavo F. Padovan
2010-11-23 23:06 ` Vinicius Costa Gomes
2010-11-24 5:32 ` Ville Tervo
2010-11-24 14:47 ` Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 13/20] Bluetooth: Implement the first SMP commands Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 14/20] Bluetooth: Start SMP procedure Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 15/20] Bluetooth: simple SMP pairing negotiation Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 16/20] Bluetooth: LE SMP Cryptoolbox functions Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 17/20] Bluetooth: Add support for using the crypto subsystem Vinicius Costa Gomes
2010-11-23 23:02 ` Gustavo F. Padovan
2010-11-23 15:06 ` [RFC 18/20] Bluetooth: Add support for SMP confirmation checks Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 19/20] Bluetooth: Add support for LE Start Encryption Vinicius Costa Gomes
2010-11-23 15:06 ` [RFC 20/20] Bluetooth: Add support for resuming socket when SMP is finished Vinicius Costa Gomes
2010-11-24 5:42 ` [RFC 00/20] Simple SMP Just Works implementation Ville Tervo
2010-11-24 21:08 ` 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=20101123224839.GA11860@vigoh \
--to=padovan@profusion.mobi \
--cc=linux-bluetooth@vger.kernel.org \
--cc=ville.tervo@nokia.com \
--cc=vinicius.gomes@openbossa.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).