Commit d3a2541d authored by Lukasz Rymanowski's avatar Lukasz Rymanowski Committed by Marcel Holtmann

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: default avatarLukasz Rymanowski <lukasz.rymanowski@tieto.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent dd2ef8e2
...@@ -3627,15 +3627,17 @@ static int confirm_name(struct sock *sk, struct hci_dev *hdev, void *data, ...@@ -3627,15 +3627,17 @@ static int confirm_name(struct sock *sk, struct hci_dev *hdev, void *data,
hci_dev_lock(hdev); hci_dev_lock(hdev);
if (!hci_discovery_active(hdev)) { if (!hci_discovery_active(hdev)) {
err = cmd_status(sk, hdev->id, MGMT_OP_CONFIRM_NAME, err = cmd_complete(sk, hdev->id, MGMT_OP_CONFIRM_NAME,
MGMT_STATUS_FAILED); MGMT_STATUS_FAILED, &cp->addr,
sizeof(cp->addr));
goto failed; goto failed;
} }
e = hci_inquiry_cache_lookup_unknown(hdev, &cp->addr.bdaddr); e = hci_inquiry_cache_lookup_unknown(hdev, &cp->addr.bdaddr);
if (!e) { if (!e) {
err = cmd_status(sk, hdev->id, MGMT_OP_CONFIRM_NAME, err = cmd_complete(sk, hdev->id, MGMT_OP_CONFIRM_NAME,
MGMT_STATUS_INVALID_PARAMS); MGMT_STATUS_INVALID_PARAMS, &cp->addr,
sizeof(cp->addr));
goto failed; goto failed;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment