Bluetooth: Fix checking for master LTKs
Subsystems (2)
PATCH 1/1 Bluetooth: Fix checking for master LTKs
From: Johan Hedberg <[email protected]>
When the rename of STK_SLAVE to simply STK happened we missed this place in the ltk_type_master function. Now, checking for master is as simple as checking whether the type is SMP_LTK. The helper function is kept around for better readability in the (right now three) callers and for simpler extension with new key types in the future.
--- net/bluetooth/hci_core.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
net/bluetooth/hci_core.c +1 -4
@@ -2974,10 +2974,7 @@ static bool hci_persistent_key(struct hci_dev *hdev, struct hci_conn *conn,static bool ltk_type_master (u8 type) { -if (type ==SMP_STK || type ==SMP_LTK ) -return true; - -return false; +return (type ==SMP_LTK ); } struct smp_ltk *hci_find_ltk(struct hci_dev *hdev, __le16 ediv, __le64 rand,
Signature · 1 line
1.9.3
Hi Johan
Quoted 30 lines · On Wed, Jun 18, 2014 at 1:09 PM, <[email protected]> wrote:
From: Johan Hedberg <[email protected]>
When the rename of
STK_SLAVEto simply STK happened we missed this place in theltk_type_masterfunction. Now, checking for master is as simple as checking whether the type isSMP_LTK. The helper function is kept around for better readability in the (right now three) callers and for simpler extension with new key types in the future.Signed-off-by Johan Hedberg <[email protected]>--- net/bluetooth/hci_core.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)net/bluetooth/hci_core.c +1
-5@@ -2974,10 +2974,7 @@ static bool hci_persistent_key(struct hci_dev *hdev, struct hci_conn *conn,static bool ltk_type_master (u8 type) { -if (type ==SMP_STK || type ==SMP_LTK ) -return true; - -return false; +return (type ==SMP_LTK ); } struct smp_ltk *hci_find_ltk(struct hci_dev *hdev, __le16 ediv, __le64 rand, --
Quoted 2 lines
1.9.3
Now bonding as responder works just fine.
Tested-by Lukasz Rymanowski <[email protected]>
Quoted 4 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
BR
Lukasz
Marcel Holtmann
maintainerHi Johan,
Quoted 10 lines
When the rename of
STK_SLAVEto simply STK happened we missed this place in theltk_type_masterfunction. Now, checking for master is as simple as checking whether the type isSMP_LTK. The helper function is kept around for better readability in the (right now three) callers and for simpler extension with new key types in the future.Signed-off-by Johan Hedberg <[email protected]>---
net/bluetooth/hci_core.c| 5 +----1 file changed, 1 insertion(+), 4 deletions(-)
patch has been applied to bluetooth-next tree.
Regards
Marcel