Re: [PATCH 2/3] Bluetooth: Fix not sending a Link Key Negative Reply

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

 



Hi Johan,

On 11:18 Mon 05 Sep, Johan Hedberg wrote:
> Hi Vinicius,
> 
> On Fri, Sep 02, 2011, Vinicius Costa Gomes wrote:
> > In the case that there are no keys loaded in the adapter, we should
> > also respond the Link Key Request event with the Link Key Negative
> > Reply command.
> > 
> > Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@xxxxxxxxxxxxx>
> > ---
> >  net/bluetooth/hci_event.c |    8 +++++---
> >  1 files changed, 5 insertions(+), 3 deletions(-)
> > 
> > diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
> > index 8404cd9..79f89d2 100644
> > --- a/net/bluetooth/hci_event.c
> > +++ b/net/bluetooth/hci_event.c
> > @@ -2208,11 +2208,13 @@ static inline void hci_link_key_request_evt(struct hci_dev *hdev, struct sk_buff
> >  
> >  	BT_DBG("%s", hdev->name);
> >  
> > -	if (!test_bit(HCI_LINK_KEYS, &hdev->flags))
> > -		return;
> > -
> >  	hci_dev_lock(hdev);
> >  
> > +	if (!test_bit(HCI_LINK_KEYS, &hdev->flags)) {
> > +		BT_DBG("%s has no keys", hdev->name);
> > +		goto not_found;
> > +	}
> > +
> >  	key = hci_find_link_key(hdev, &ev->bdaddr);
> >  	if (!key) {
> >  		BT_DBG("%s link key not found for %s", hdev->name,
> > -- 
> > 1.7.6.1
> 
> Nack. The purpose of this check in the beginning of the function is to
> prevent breakage on systems that do not use the management interface.
> With your patch you'd break all systems that use hciops. The
> HCI_LINK_KEYS bit will only be set when user space sends the
> MGMT_OP_LOAD_KEYS command.

Ok. This patch is to be ignored then. The rest of the series should should
still be considered.

> 
> Johan

Cheers,
-- 
Vinicius
--
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