linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: Fix checking the wrong flag when accepting a socket
@ 2012-06-01  1:53 Vinicius Costa Gomes
  2012-06-01  7:12 ` Andrei Emeltchenko
  2012-06-01 23:00 ` Gustavo Padovan
  0 siblings, 2 replies; 5+ messages in thread
From: Vinicius Costa Gomes @ 2012-06-01  1:53 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Vinicius Costa Gomes

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 <vinicius.gomes@openbossa.org>
---
 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Bluetooth: Fix checking the wrong flag when accepting a socket
  2012-06-01  1:53 [PATCH] Bluetooth: Fix checking the wrong flag when accepting a socket Vinicius Costa Gomes
@ 2012-06-01  7:12 ` Andrei Emeltchenko
  2012-06-01 23:00 ` Gustavo Padovan
  1 sibling, 0 replies; 5+ messages in thread
From: Andrei Emeltchenko @ 2012-06-01  7:12 UTC (permalink / raw)
  To: Vinicius Costa Gomes; +Cc: linux-bluetooth

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 <vinicius.gomes@openbossa.org>

Good catch, this was recently introduced by commit c5daa683

Acked-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> 

> ---
>  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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Bluetooth: Fix checking the wrong flag when accepting a socket
  2012-06-01  1:53 [PATCH] Bluetooth: Fix checking the wrong flag when accepting a socket Vinicius Costa Gomes
  2012-06-01  7:12 ` Andrei Emeltchenko
@ 2012-06-01 23:00 ` Gustavo Padovan
  2012-06-05  3:01   ` Johan Hedberg
  1 sibling, 1 reply; 5+ messages in thread
From: Gustavo Padovan @ 2012-06-01 23:00 UTC (permalink / raw)
  To: Vinicius Costa Gomes; +Cc: linux-bluetooth

Hi Vinicius,

* Vinicius Costa Gomes <vinicius.gomes@openbossa.org> [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 <vinicius.gomes@openbossa.org>
> ---
>  net/bluetooth/af_bluetooth.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Patch has been applied to bluetooth-next. thanks.

	Gustavo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Bluetooth: Fix checking the wrong flag when accepting a socket
  2012-06-01 23:00 ` Gustavo Padovan
@ 2012-06-05  3:01   ` Johan Hedberg
  2012-06-05  3:15     ` Johan Hedberg
  0 siblings, 1 reply; 5+ messages in thread
From: Johan Hedberg @ 2012-06-05  3:01 UTC (permalink / raw)
  To: Gustavo Padovan, Vinicius Costa Gomes, linux-bluetooth

Hi Gustavo,

On Fri, Jun 01, 2012, Gustavo Padovan wrote:
> * Vinicius Costa Gomes <vinicius.gomes@openbossa.org> [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 <vinicius.gomes@openbossa.org>
> > ---
> >  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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Bluetooth: Fix checking the wrong flag when accepting a socket
  2012-06-05  3:01   ` Johan Hedberg
@ 2012-06-05  3:15     ` Johan Hedberg
  0 siblings, 0 replies; 5+ messages in thread
From: Johan Hedberg @ 2012-06-05  3:15 UTC (permalink / raw)
  To: Gustavo Padovan, Vinicius Costa Gomes, linux-bluetooth

Hi,

On Tue, Jun 05, 2012, Johan Hedberg wrote:
> On Fri, Jun 01, 2012, Gustavo Padovan wrote:
> > * Vinicius Costa Gomes <vinicius.gomes@openbossa.org> [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 <vinicius.gomes@openbossa.org>
> > > ---
> > >  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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-06-05  3:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-01  1:53 [PATCH] Bluetooth: Fix checking the wrong flag when accepting a socket Vinicius Costa Gomes
2012-06-01  7:12 ` Andrei Emeltchenko
2012-06-01 23:00 ` Gustavo Padovan
2012-06-05  3:01   ` Johan Hedberg
2012-06-05  3:15     ` Johan Hedberg

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).