提交 21b93b75 编写于 作者: J Johan Hedberg

Bluetooth: Make LTK key type check more readable

Instead of magic bitwise operations simply compare with the two possible
type values that we are interested in.
Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 f813f1be
...@@ -2717,7 +2717,7 @@ int hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 addr_type, u8 type, ...@@ -2717,7 +2717,7 @@ int hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 addr_type, u8 type,
if (!new_key) if (!new_key)
return 0; return 0;
if (type & HCI_SMP_LTK) if (type == HCI_SMP_LTK || type == HCI_SMP_LTK_SLAVE)
mgmt_new_ltk(hdev, key, 1); mgmt_new_ltk(hdev, key, 1);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册