Re: [PATCH 2/5] Bluetooth: Handle command complete event for HCI Read Stored Link Keys

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Johan,

>> +static void hci_cc_read_stored_link_key(struct hci_dev *hdev,
>> +					struct sk_buff *skb)
>> +{
>> +	struct hci_rp_read_stored_link_key *rp = (void *)skb->data;
>> +	struct hci_cp_read_stored_link_key *sent;
>> +
>> +	BT_DBG("%s status 0x%2.2x", hdev->name, rp->status);
>> +
>> +	sent = hci_sent_cmd_data(hdev, HCI_OP_READ_STORED_LINK_KEY);
>> +	if (!sent)
>> +		return;
>> +
>> +	if (!rp->status && !bacmp(&sent->bdaddr, BDADDR_ANY)) {
>> +		hdev->stored_max_keys = rp->max_keys;
>> +		hdev->stored_num_keys = rp->num_keys;
>> +	}
> 
> This probably works fine, but strictly speaking I think you should be
> looking at the sent->read_all flag as that's the explicit indication
> that the all keys had been requested. In theory the sent->bdaddr value
> may be anything for read_all = 0x01 as the spec says that the bdaddr is
> simply ignored then.

good catch actually. I will fix that.

Regards

Marcel

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux