aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/mgmt.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-10-26 15:52:27 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-12-03 10:51:21 -0500
commit86df9200c77f46a246ca4a78949887eb6dbde091 (patch)
tree0315eb42bda394f4b24961d10a36ab891ecf4078 /net/bluetooth/mgmt.c
parent6928a9245f2998478047dcc3efad30734766a226 (diff)
Bluetooth: Add support for adding remote OOB data for LE
This patch adds proper support for passing LE OOB data to the hci_add_remote_oob_data() function. For LE the 192-bit values are not valid and should therefore be passed as NULL values. 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.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 57de9f7222aa..1e73bead7dd9 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -3610,6 +3610,7 @@ static int add_remote_oob_data(struct sock *sk, struct hci_dev *hdev,
3610 status, &cp->addr, sizeof(cp->addr)); 3610 status, &cp->addr, sizeof(cp->addr));
3611 } else if (len == MGMT_ADD_REMOTE_OOB_EXT_DATA_SIZE) { 3611 } else if (len == MGMT_ADD_REMOTE_OOB_EXT_DATA_SIZE) {
3612 struct mgmt_cp_add_remote_oob_ext_data *cp = data; 3612 struct mgmt_cp_add_remote_oob_ext_data *cp = data;
3613 u8 *rand192, *hash192;
3613 u8 status; 3614 u8 status;
3614 3615
3615 if (cp->addr.type != BDADDR_BREDR) { 3616 if (cp->addr.type != BDADDR_BREDR) {
@@ -3620,10 +3621,17 @@ static int add_remote_oob_data(struct sock *sk, struct hci_dev *hdev,
3620 goto unlock; 3621 goto unlock;
3621 } 3622 }
3622 3623
3624 if (bdaddr_type_is_le(cp->addr.type)) {
3625 rand192 = NULL;
3626 hash192 = NULL;
3627 } else {
3628 rand192 = cp->rand192;
3629 hash192 = cp->hash192;
3630 }
3631
3623 err = hci_add_remote_oob_data(hdev, &cp->addr.bdaddr, 3632 err = hci_add_remote_oob_data(hdev, &cp->addr.bdaddr,
3624 cp->addr.type, cp->hash192, 3633 cp->addr.type, hash192, rand192,
3625 cp->rand192, cp->hash256, 3634 cp->hash256, cp->rand256);
3626 cp->rand256);
3627 if (err < 0) 3635 if (err < 0)
3628 status = MGMT_STATUS_FAILED; 3636 status = MGMT_STATUS_FAILED;
3629 else 3637 else