linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: Fix error message when pairing fails
@ 2012-10-25 19:08 Paulo Sérgio
  2012-10-25 19:55 ` [PATCH] Bluetooth: Fix error status " Paulo Sérgio
  0 siblings, 1 reply; 3+ messages in thread
From: Paulo Sérgio @ 2012-10-25 19:08 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Paulo Sérgio

When pairing fails due to wrong confirm value, the management layer
doesn't report a proper error message. It sends a
MGMT_STATUS_CONNECT_FAILED instead of a MGMT_STATUS_AUTH_FAILED.

Most of management functions that receive a status as a parameter
expects for it to be encoded as a HCI status. But when a SMP pairing
fails, the SMP layer sends the SMP reason as the error status to the
management layer.

This commit maps all SMP reasons to HCI_ERROR_AUTH_FAILURE, which will
be converted to MGMT_STATUS_AUTH_FAILED in the management layer.

Reported-by: Claudio Takahasi <claudio.takahasi@openbossa.org>
Reviewed-by: João Paulo Rechi Vita <jprvita@openbossa.org>
Signed-off-by: Paulo Sérgio <paulo.sergio@openbossa.org>
---
 net/bluetooth/smp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index b542c5d..b3b7cc0 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -266,7 +266,7 @@ static void smp_failure(struct l2cap_conn *conn, u8 reason, u8 send)
 
 	clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->hcon->flags);
 	mgmt_auth_failed(conn->hcon->hdev, conn->dst, hcon->type,
-			 hcon->dst_type, reason);
+			 hcon->dst_type, HCI_ERROR_AUTH_FAILURE);
 
 	cancel_delayed_work_sync(&conn->security_timer);
 
-- 
1.7.9.5


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

* [PATCH] Bluetooth: Fix error status when pairing fails
  2012-10-25 19:08 [PATCH] Bluetooth: Fix error message when pairing fails Paulo Sérgio
@ 2012-10-25 19:55 ` Paulo Sérgio
  2012-10-26 14:18   ` Gustavo Padovan
  0 siblings, 1 reply; 3+ messages in thread
From: Paulo Sérgio @ 2012-10-25 19:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Paulo Sérgio

When pairing fails due to wrong confirm value, the management layer
doesn't report a proper error status. It sends
MGMT_STATUS_CONNECT_FAILED instead of MGMT_STATUS_AUTH_FAILED.

Most of management functions that receive a status as a parameter
expects for it to be encoded as a HCI status. But when a SMP pairing
fails, the SMP layer sends the SMP reason as the error status to the
management layer.

This commit maps all SMP reasons to HCI_ERROR_AUTH_FAILURE, which will
be converted to MGMT_STATUS_AUTH_FAILED in the management layer.

Reported-by: Claudio Takahasi <claudio.takahasi@openbossa.org>
Reviewed-by: João Paulo Rechi Vita <jprvita@openbossa.org>
Signed-off-by: Paulo Sérgio <paulo.sergio@openbossa.org>
---

Please, disconsider the previous patch. It had a wrong commit message.

PS: This is my first patch.

 net/bluetooth/smp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index b542c5d..b3b7cc0 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -266,7 +266,7 @@ static void smp_failure(struct l2cap_conn *conn, u8 reason, u8 send)
 
 	clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->hcon->flags);
 	mgmt_auth_failed(conn->hcon->hdev, conn->dst, hcon->type,
-			 hcon->dst_type, reason);
+			 hcon->dst_type, HCI_ERROR_AUTH_FAILURE);
 
 	cancel_delayed_work_sync(&conn->security_timer);
 
-- 
1.7.9.5


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

* Re: [PATCH] Bluetooth: Fix error status when pairing fails
  2012-10-25 19:55 ` [PATCH] Bluetooth: Fix error status " Paulo Sérgio
@ 2012-10-26 14:18   ` Gustavo Padovan
  0 siblings, 0 replies; 3+ messages in thread
From: Gustavo Padovan @ 2012-10-26 14:18 UTC (permalink / raw)
  To: Paulo Sérgio; +Cc: linux-bluetooth

Hi Paulo,

* Paulo Sérgio <paulo.sergio@openbossa.org> [2012-10-25 16:55:51 -0300]:

> When pairing fails due to wrong confirm value, the management layer
> doesn't report a proper error status. It sends
> MGMT_STATUS_CONNECT_FAILED instead of MGMT_STATUS_AUTH_FAILED.
> 
> Most of management functions that receive a status as a parameter
> expects for it to be encoded as a HCI status. But when a SMP pairing
> fails, the SMP layer sends the SMP reason as the error status to the
> management layer.
> 
> This commit maps all SMP reasons to HCI_ERROR_AUTH_FAILURE, which will
> be converted to MGMT_STATUS_AUTH_FAILED in the management layer.
> 
> Reported-by: Claudio Takahasi <claudio.takahasi@openbossa.org>
> Reviewed-by: João Paulo Rechi Vita <jprvita@openbossa.org>
> Signed-off-by: Paulo Sérgio <paulo.sergio@openbossa.org>
> ---
> 
> Please, disconsider the previous patch. It had a wrong commit message.
> 
> PS: This is my first patch.
> 
>  net/bluetooth/smp.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Patch has been applied to bluetooth.git. Thanks

	Gustavo

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

end of thread, other threads:[~2012-10-26 14:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-25 19:08 [PATCH] Bluetooth: Fix error message when pairing fails Paulo Sérgio
2012-10-25 19:55 ` [PATCH] Bluetooth: Fix error status " Paulo Sérgio
2012-10-26 14:18   ` Gustavo Padovan

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