Skip to content

Commit

Permalink
Bluetooth: Fix clearing remote OOB data through mgmt
Browse files Browse the repository at this point in the history
When passed BDADDR_ANY the Remove Remote OOB Data comand is specified to
clear all entries. This patch adds the necessary check and calls
hci_remote_oob_data_clear() when necessary.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Johan Hedberg authored and Marcel Holtmann committed Nov 15, 2014
1 parent 49d1174 commit eedbd58
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -3635,12 +3635,19 @@ static int remove_remote_oob_data(struct sock *sk, struct hci_dev *hdev,

hci_dev_lock(hdev);

if (!bacmp(&cp->addr.bdaddr, BDADDR_ANY)) {
hci_remote_oob_data_clear(hdev);
status = MGMT_STATUS_SUCCESS;
goto done;
}

err = hci_remove_remote_oob_data(hdev, &cp->addr.bdaddr);
if (err < 0)
status = MGMT_STATUS_INVALID_PARAMS;
else
status = MGMT_STATUS_SUCCESS;

done:
err = cmd_complete(sk, hdev->id, MGMT_OP_REMOVE_REMOTE_OOB_DATA,
status, &cp->addr, sizeof(cp->addr));

Expand Down

0 comments on commit eedbd58

Please sign in to comment.