diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2014-11-15 09:34:23 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-11-15 09:00:29 +0100 |
commit | eedbd5812c2afe79646a7c1c071875e46c867935 (patch) | |
tree | e9703904b9a4416de21d7037db6226e4c36e2c59 /net/bluetooth/mgmt.c | |
parent | 49d1174130df596fcfec3b6a56dce8aa5b997f2d (diff) | |
download | op-kernel-dev-eedbd5812c2afe79646a7c1c071875e46c867935.zip op-kernel-dev-eedbd5812c2afe79646a7c1c071875e46c867935.tar.gz |
Bluetooth: Fix clearing remote OOB data through mgmt
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>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r-- | net/bluetooth/mgmt.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index ce0272c..b84c092 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -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)); |