aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukasz Rymanowski <lukasz.rymanowski@tieto.com>2014-02-27 10:47:28 -0500
committerMarcel Holtmann <marcel@holtmann.org>2014-02-27 11:41:09 -0500
commitd3a2541d83dbdb4dd35eb34ac45b036acde278c6 (patch)
tree3c8b9e501739acec687a9d051c7e69d1e83d2823
parentdd2ef8e274b265a0af1cc0d3ddafd361fc3a00a6 (diff)
Bluetooth: Fix response on confirm_name
According to mgmt-api.txt, in case of confirm name command, cmd_complete should be always use as a response. Not command status as it is now for failures. Using command complete on failure is actually better as client might be interested in device address for which confirm name failed. Signed-off-by: Lukasz Rymanowski <lukasz.rymanowski@tieto.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r--net/bluetooth/mgmt.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 4c4912e9a7c4..78ac7c864044 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -3627,15 +3627,17 @@ static int confirm_name(struct sock *sk, struct hci_dev *hdev, void *data,
3627 hci_dev_lock(hdev); 3627 hci_dev_lock(hdev);
3628 3628
3629 if (!hci_discovery_active(hdev)) { 3629 if (!hci_discovery_active(hdev)) {
3630 err = cmd_status(sk, hdev->id, MGMT_OP_CONFIRM_NAME, 3630 err = cmd_complete(sk, hdev->id, MGMT_OP_CONFIRM_NAME,
3631 MGMT_STATUS_FAILED); 3631 MGMT_STATUS_FAILED, &cp->addr,
3632 sizeof(cp->addr));
3632 goto failed; 3633 goto failed;
3633 } 3634 }
3634 3635
3635 e = hci_inquiry_cache_lookup_unknown(hdev, &cp->addr.bdaddr); 3636 e = hci_inquiry_cache_lookup_unknown(hdev, &cp->addr.bdaddr);
3636 if (!e) { 3637 if (!e) {
3637 err = cmd_status(sk, hdev->id, MGMT_OP_CONFIRM_NAME, 3638 err = cmd_complete(sk, hdev->id, MGMT_OP_CONFIRM_NAME,
3638 MGMT_STATUS_INVALID_PARAMS); 3639 MGMT_STATUS_INVALID_PARAMS, &cp->addr,
3640 sizeof(cp->addr));
3639 goto failed; 3641 goto failed;
3640 } 3642 }
3641 3643