device: warn on BR/EDR connection key mismatch
PATCH 1/1 device: warn on BR/EDR connection key mismatch
From: lazy-pir8 <[email protected]>
Log a clear message when a device fails to connect due to Bluetooth BR/EDR keys changing (e.g., after pairing from another system). Advises user to remove and re-pair the device.
--- src/device.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)
src/device.c +17 -4
@@ -2066,10 +2066,23 @@ void device_request_disconnect(struct btd_device *device, DBusMessage *msg)const char *err_str;DBusMessage *reply; -if (device->bonding_status ==MGMT_STATUS_AUTH_FAILED ) - err_str =ERR_BREDR_CONN_KEY_MISSING ; -else - err_str =ERR_BREDR_CONN_CANCELED ; +if (device->bonding_status ==MGMT_STATUS_AUTH_FAILED ) { +char name[256 ] = {0 }; + +device_get_name (device, name,sizeof (name)); + +if (name[0 ] =='\0' ) +snprintf (name,sizeof (name),"unknown" ); + +error ("DEBUG HIT: Connection failed for %s (key missing case)" , name); + +warn ("Connection failed for %s. The device keys may have changed (e.g. pairing from another system). Consider removing and re-pairing." , + name); + + err_str =ERR_BREDR_CONN_KEY_MISSING ; + }else { + err_str =ERR_BREDR_CONN_CANCELED ; + } reply =btd_error_failed (device->connect, err_str);g_dbus_send_message (dbus_conn, reply);dbus_message_unref (device->connect);
Signature · 1 line
2.53.0
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=1077174
---Test result---
Test Summary:
CheckPatch PENDING 0.35 seconds GitLint PENDING 0.36 seconds BuildEll PASS 20.06 seconds BluezMake PASS 647.07 seconds MakeCheck PASS 18.75 seconds MakeDistcheck PASS 247.14 seconds CheckValgrind PASS 294.87 seconds CheckSmatch PASS 351.06 seconds bluezmakeextell PASS 183.74 seconds IncrementalBuild PENDING 0.35 seconds ScanBuild PASS 1017.39 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series Output:
https://github.com/bluez/bluez/pull/2013/checks
---
Regards,
Linux Bluetooth