diff options
author | Vinicius Costa Gomes <vinicius.gomes@openbossa.org> | 2012-02-02 19:08:03 -0500 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-02-13 10:01:33 -0500 |
commit | b0dbfb46ba0c0d2fe4c90e2046f7b36275763a7e (patch) | |
tree | 1251bab1d951ff7c42f9f2e3d8f0b4d35b808d83 /net/bluetooth/mgmt.c | |
parent | 346af67b8d116f01ef696fd47959a55deb2db8b6 (diff) |
Bluetooth: Add support for removing LTK's when pairing is removed
Instead of having a separated command for removing SMP keys, we use the
Remove Keys command to remove *all* keys.
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r-- | net/bluetooth/mgmt.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index fd0b08115f2e..9e5dead1dbef 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -1089,6 +1089,12 @@ static int remove_keys(struct sock *sk, u16 index, void *data, u16 len) | |||
1089 | bacpy(&rp.bdaddr, &cp->bdaddr); | 1089 | bacpy(&rp.bdaddr, &cp->bdaddr); |
1090 | rp.status = MGMT_STATUS_FAILED; | 1090 | rp.status = MGMT_STATUS_FAILED; |
1091 | 1091 | ||
1092 | err = hci_remove_ltk(hdev, &cp->bdaddr); | ||
1093 | if (err < 0) { | ||
1094 | err = cmd_status(sk, index, MGMT_OP_REMOVE_KEYS, -err); | ||
1095 | goto unlock; | ||
1096 | } | ||
1097 | |||
1092 | err = hci_remove_link_key(hdev, &cp->bdaddr); | 1098 | err = hci_remove_link_key(hdev, &cp->bdaddr); |
1093 | if (err < 0) { | 1099 | if (err < 0) { |
1094 | rp.status = MGMT_STATUS_NOT_PAIRED; | 1100 | rp.status = MGMT_STATUS_NOT_PAIRED; |