Skip to contentSkip to conversation

Bluetooth: Fix mgmt error code for negative PIN response

PATCH In review [email protected] 2 participants 2 messages Jan 13, 2014 – Jan 16, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: Fix mgmt error code for negative PIN response

From: Johan Hedberg <[email protected]>

The NOT_PAIRED status is only really suitable for operations where being paired is a pre-requisite. Using it e.g. for the mgmt_pair_device command seems unintuitive. In the case that either the local or the remote user responds with a negative PIN Code response the "PIN or Key Missing" HCI status will be generated. This patch changes the mapping of this status from the NOT_PAIRED mgmt status to the more intuitive AUTH_FAILED mgmt status.

---
I had trouble deciding whether we should use REJECTED or AUTH_FAILED here, but eventually went with AUTH_FAILED. If someone thinks REJECTED is better and has convincing reasons for it I can change it.

 net/bluetooth/mgmt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/mgmt.c +1 -1
index 4b6034fcc902..4ee07b432379 100644
@@ -128,7 +128,7 @@ static u8 mgmt_status_table[] = {
 	MGMT_STATUS_FAILED,		/* Hardware Failure */
 	MGMT_STATUS_CONNECT_FAILED,	/* Page Timeout */
 	MGMT_STATUS_AUTH_FAILED,	/* Authentication Failed */
-	MGMT_STATUS_NOT_PAIRED,		/* PIN or Key Missing */
+	MGMT_STATUS_AUTH_FAILED,	/* PIN or Key Missing */
 	MGMT_STATUS_NO_RESOURCES,	/* Memory Full */
 	MGMT_STATUS_TIMEOUT,		/* Connection Timeout */
 	MGMT_STATUS_NO_RESOURCES,	/* Max Number of Connections */
Signature · 1 line
1.8.4.2
maintainer
#1 lore raw

Hi Johan,

Quoted 8 lines

The NOT_PAIRED status is only really suitable for operations where being paired is a pre-requisite. Using it e.g. for the mgmt_pair_device command seems unintuitive. In the case that either the local or the remote user responds with a negative PIN Code response the "PIN or Key Missing" HCI status will be generated. This patch changes the mapping of this status from the NOT_PAIRED mgmt status to the more intuitive AUTH_FAILED mgmt status.

Quoted 8 lines

---
I had trouble deciding whether we should use REJECTED or AUTH_FAILED here, but eventually went with AUTH_FAILED. If someone thinks REJECTED is better and has convincing reasons for it I can change it.

net/bluetooth/mgmt.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel