Skip to content

Commit

Permalink
Bluetooth: mgmt: Add address type to link key messages
Browse files Browse the repository at this point in the history
The latest mgmt API includes an address type wherever there's an address
present. This patch updates the link key messages to match it.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Johan Hedberg committed Feb 17, 2012
1 parent 42d2d87 commit d753fdc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/net/bluetooth/mgmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ struct mgmt_cp_remove_uuid {
} __packed;

struct mgmt_link_key_info {
bdaddr_t bdaddr;
struct mgmt_addr_info addr;
u8 type;
u8 val[16];
u8 pin_len;
Expand Down
7 changes: 4 additions & 3 deletions net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1274,8 +1274,8 @@ static int load_link_keys(struct sock *sk, u16 index, void *data, u16 len)
for (i = 0; i < key_count; i++) {
struct mgmt_link_key_info *key = &cp->keys[i];

hci_add_link_key(hdev, NULL, 0, &key->bdaddr, key->val, key->type,
key->pin_len);
hci_add_link_key(hdev, NULL, 0, &key->addr.bdaddr, key->val,
key->type, key->pin_len);
}

cmd_complete(sk, index, MGMT_OP_LOAD_LINK_KEYS, NULL, 0);
Expand Down Expand Up @@ -2788,7 +2788,8 @@ int mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key,
memset(&ev, 0, sizeof(ev));

ev.store_hint = persistent;
bacpy(&ev.key.bdaddr, &key->bdaddr);
bacpy(&ev.key.addr.bdaddr, &key->bdaddr);
ev.key.addr.type = MGMT_ADDR_BREDR;
ev.key.type = key->type;
memcpy(ev.key.val, key->val, 16);
ev.key.pin_len = key->pin_len;
Expand Down

0 comments on commit d753fdc

Please sign in to comment.