2012-06-01 01:53:39

by Vinicius Costa Gomes

[permalink] [raw]
Subject: [PATCH] Bluetooth: Fix checking the wrong flag when accepting a socket

Most probably a typo, the check should have been for BT_SK_DEFER_SETUP
instead of BT_DEFER_SETUP (which right now only represents a socket
option).

Signed-off-by: Vinicius Costa Gomes <[email protected]>
---
net/bluetooth/af_bluetooth.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c
index 2517472..f7db579 100644
--- a/net/bluetooth/af_bluetooth.c
+++ b/net/bluetooth/af_bluetooth.c
@@ -199,7 +199,7 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock)
}

if (sk->sk_state == BT_CONNECTED || !newsock ||
- test_bit(BT_DEFER_SETUP, &bt_sk(parent)->flags)) {
+ test_bit(BT_SK_DEFER_SETUP, &bt_sk(parent)->flags)) {
bt_accept_unlink(sk);
if (newsock)
sock_graft(sk, newsock);
--
1.7.10.3



2012-06-05 03:15:01

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: Fix checking the wrong flag when accepting a socket

Hi,

On Tue, Jun 05, 2012, Johan Hedberg wrote:
> On Fri, Jun 01, 2012, Gustavo Padovan wrote:
> > * Vinicius Costa Gomes <[email protected]> [2012-05-31 22:53:39 -0300]:
> >
> > > Most probably a typo, the check should have been for BT_SK_DEFER_SETUP
> > > instead of BT_DEFER_SETUP (which right now only represents a socket
> > > option).
> > >
> > > Signed-off-by: Vinicius Costa Gomes <[email protected]>
> > > ---
> > > net/bluetooth/af_bluetooth.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > Patch has been applied to bluetooth-next. thanks.
>
> This patch fixes accepting L2CAP and RFCOMM connections for sockets with
> defer setup enabled (i.e. pretty much *all* sockets we have). This is
> now broken in 3.5-rc1 so the patch should go with the highest priority
> to the upstream trees. Furthermore, you said you applied it to
> bluetooth-next but it's not there. What's going on?

Actually the patch is in bluetooth-next (I was checking the wrong tree),
sorry about the false alarm there. However the patch really needs to go
to bluetooth.git too and then onwards to the upstream trees.

Johan

2012-06-05 03:01:51

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: Fix checking the wrong flag when accepting a socket

Hi Gustavo,

On Fri, Jun 01, 2012, Gustavo Padovan wrote:
> * Vinicius Costa Gomes <[email protected]> [2012-05-31 22:53:39 -0300]:
>
> > Most probably a typo, the check should have been for BT_SK_DEFER_SETUP
> > instead of BT_DEFER_SETUP (which right now only represents a socket
> > option).
> >
> > Signed-off-by: Vinicius Costa Gomes <[email protected]>
> > ---
> > net/bluetooth/af_bluetooth.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Patch has been applied to bluetooth-next. thanks.

This patch fixes accepting L2CAP and RFCOMM connections for sockets with
defer setup enabled (i.e. pretty much *all* sockets we have). This is
now broken in 3.5-rc1 so the patch should go with the highest priority
to the upstream trees. Furthermore, you said you applied it to
bluetooth-next but it's not there. What's going on?

Johan

2012-06-01 23:00:52

by Gustavo Padovan

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: Fix checking the wrong flag when accepting a socket

Hi Vinicius,

* Vinicius Costa Gomes <[email protected]> [2012-05-31 22:53:39 -0300]:

> Most probably a typo, the check should have been for BT_SK_DEFER_SETUP
> instead of BT_DEFER_SETUP (which right now only represents a socket
> option).
>
> Signed-off-by: Vinicius Costa Gomes <[email protected]>
> ---
> net/bluetooth/af_bluetooth.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Patch has been applied to bluetooth-next. thanks.

Gustavo

2012-06-01 07:12:21

by Andrei Emeltchenko

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: Fix checking the wrong flag when accepting a socket

Hi Vinicius

On Thu, May 31, 2012 at 10:53:39PM -0300, Vinicius Costa Gomes wrote:
> Most probably a typo, the check should have been for BT_SK_DEFER_SETUP
> instead of BT_DEFER_SETUP (which right now only represents a socket
> option).
>
> Signed-off-by: Vinicius Costa Gomes <[email protected]>

Good catch, this was recently introduced by commit c5daa683

Acked-by: Andrei Emeltchenko <[email protected]>

> ---
> net/bluetooth/af_bluetooth.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c
> index 2517472..f7db579 100644
> --- a/net/bluetooth/af_bluetooth.c
> +++ b/net/bluetooth/af_bluetooth.c
> @@ -199,7 +199,7 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock)
> }
>
> if (sk->sk_state == BT_CONNECTED || !newsock ||
> - test_bit(BT_DEFER_SETUP, &bt_sk(parent)->flags)) {
> + test_bit(BT_SK_DEFER_SETUP, &bt_sk(parent)->flags)) {
> bt_accept_unlink(sk);
> if (newsock)
> sock_graft(sk, newsock);
> --
> 1.7.10.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html