diff options
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r-- | net/bluetooth/mgmt.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index b50e2ee2595c..7d37c88e4bf5 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -1644,6 +1644,18 @@ static u8 link_to_mgmt(u8 link_type, u8 addr_type) | |||
1644 | } | 1644 | } |
1645 | } | 1645 | } |
1646 | 1646 | ||
1647 | static u8 mgmt_to_le(u8 mgmt_type) | ||
1648 | { | ||
1649 | switch (mgmt_type) { | ||
1650 | case MGMT_ADDR_LE_PUBLIC: | ||
1651 | return ADDR_LE_DEV_PUBLIC; | ||
1652 | |||
1653 | default: | ||
1654 | /* Fallback to LE Random address type */ | ||
1655 | return ADDR_LE_DEV_RANDOM; | ||
1656 | } | ||
1657 | } | ||
1658 | |||
1647 | static int get_connections(struct sock *sk, struct hci_dev *hdev, void *data, | 1659 | static int get_connections(struct sock *sk, struct hci_dev *hdev, void *data, |
1648 | u16 data_len) | 1660 | u16 data_len) |
1649 | { | 1661 | { |
@@ -2652,7 +2664,8 @@ static int load_long_term_keys(struct sock *sk, struct hci_dev *hdev, | |||
2652 | else | 2664 | else |
2653 | type = HCI_SMP_LTK_SLAVE; | 2665 | type = HCI_SMP_LTK_SLAVE; |
2654 | 2666 | ||
2655 | hci_add_ltk(hdev, &key->addr.bdaddr, key->addr.type, | 2667 | hci_add_ltk(hdev, &key->addr.bdaddr, |
2668 | mgmt_to_le(key->addr.type), | ||
2656 | type, 0, key->authenticated, key->val, | 2669 | type, 0, key->authenticated, key->val, |
2657 | key->enc_size, key->ediv, key->rand); | 2670 | key->enc_size, key->ediv, key->rand); |
2658 | } | 2671 | } |