diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2014-02-18 19:14:31 +0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-02-18 20:58:20 +0400 |
commit | e0b2b27e622da0ba8a3d253b985d3d8f174b4313 (patch) | |
tree | 667dcec52ed49711b1563bff486a164029be5614 /net/bluetooth/hci_core.c | |
parent | 6131ddc8eb9bad8c4ff37e097b2537c819b76cc0 (diff) | |
download | linux-e0b2b27e622da0ba8a3d253b985d3d8f174b4313.tar.xz |
Bluetooth: Fix missing address type check for removing LTKs
When removing Long Term Keys we should also be checking that the given
address type (public vs random) matches. This patch updates the
hci_remove_ltk function to take an extra parameter and uses it for
address type matching.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_core.c')
-rw-r--r-- | net/bluetooth/hci_core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 59a76b2566eb..957c8f4cc4c7 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -2810,12 +2810,12 @@ int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr) return 0; } -int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr) +int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 bdaddr_type) { struct smp_ltk *k, *tmp; list_for_each_entry_safe(k, tmp, &hdev->long_term_keys, list) { - if (bacmp(bdaddr, &k->bdaddr)) + if (bacmp(bdaddr, &k->bdaddr) || k->bdaddr_type != bdaddr_type) continue; BT_DBG("%s removing %pMR", hdev->name, bdaddr); |