Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 516600 - net-wireless/bluez-5* - bluetoothd refuses to read stored device key upon reconnect
Summary: net-wireless/bluez-5* - bluetoothd refuses to read stored device key upon rec...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Pacho Ramos
URL: https://bugzilla.kernel.org/show_bug....
Whiteboard:
Keywords: PATCH, UPSTREAM
Depends on:
Blocks:
 
Reported: 2014-07-07 10:59 UTC by 4nykey
Modified: 2014-09-13 12:28 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
changes to src/adapter.c (bluez-loadkeys.patch,419 bytes, patch)
2014-07-07 11:03 UTC, 4nykey
Details | Diff
emerge --info (emerge.info,21.99 KB, text/plain)
2014-07-07 11:09 UTC, 4nykey
Details

Note You need to log in before you can comment on or make changes to this bug.
Description 4nykey 2014-07-07 10:59:13 UTC
After daemon restart, previously added device won't reconnect.

Reproducible: Always

Steps to Reproduce:
1. Add a BT device (via gnome-control-center or bluetoothctl)
2. Restart bluetooth.service
Actual Results:  
> bluetoothd[1234]: Refusing input device connect: No such file or directory (2)
> bluetoothd[1234]: Refusing connection from xx:xx:xx:xx:xx:xx: unknown device

Expected Results:  
Previously added device will restore connection

The device key is present in /var/lib/bluetooth/<adapter:addr>/<device:addr>/info, but running '/usr/libexec/bluetooth/bluetoothd -dn' will produce:

> src/adapter.c:load_link_keys() hci0 keys 0 debug_keys 0
Comment 1 4nykey 2014-07-07 11:03:53 UTC
Created attachment 380362 [details, diff]
changes to src/adapter.c

After applying this, bluetoothd will read the stored key and connect to the device:

> src/adapter.c:load_link_keys() hci0 keys 1 debug_keys 0
Comment 2 4nykey 2014-07-07 11:09:29 UTC
Created attachment 380364 [details]
emerge --info
Comment 3 Pacho Ramos gentoo-dev 2014-07-08 08:37:35 UTC
Do you get the same with bluez-5.20-r1?
Comment 4 Pacho Ramos gentoo-dev 2014-07-08 08:52:03 UTC
Or even better with 5.21 that upstream released a few days ago :)
Comment 5 4nykey 2014-07-09 07:22:43 UTC
(In reply to Pacho Ramos from comment #3)
> Do you get the same with bluez-5.20-r1?

Yes, as with every bluez5 release starting from v5.10, including v5.21.
Comment 6 4nykey 2014-07-09 07:43:34 UTC
By the way, Jeroen, mine bug summary was correct.

I can reconnect a device _while daemon is running_ (eg switch mouse off, back on and it will connect).

It's when the daemon is restarted - it searches for previously stored devices, and _finds none_:

> load_link_keys() hci0 keys 0
Comment 7 Pacho Ramos gentoo-dev 2014-07-09 08:37:28 UTC
You would need to upstream this patch either in bluetooth mailing list or in https://bugzilla.kernel.org/enter_bug.cgi?product=Drivers (Component -> bluetooth)
Comment 8 Pacho Ramos gentoo-dev 2014-07-24 07:53:37 UTC
Please try if you still need this with 5.21-r1
Comment 9 4nykey 2014-07-24 22:40:54 UTC
(In reply to Pacho Ramos from comment #8)
> Please try if you still need this with 5.21-r1

Yes, it's the same.

Proper fix was added to the git:  http://git.kernel.org/cgit/bluetooth/bluez.git/commit/?id=aeb998cac207ca2134618c5567fb2d5503d94245 which fixes the issue for me.

It will land in 5.22, I guess
Comment 10 Pacho Ramos gentoo-dev 2014-07-25 08:12:55 UTC
Nice to know, thanks. 5.21-r1 fixed a long standing bug that was causing many different failures and I wanted to ensure this wasn't a side effect of that too ;)
Comment 11 Pacho Ramos gentoo-dev 2014-09-13 12:28:39 UTC
should be ok in 5.23