* [PATCH BlueZ 0/2] Report proper error on connect
@ 2023-08-06 8:01 Simon Mikuda
2023-08-06 8:01 ` [PATCH BlueZ 1/2] error: Add "Invalid exchange" mapping Simon Mikuda
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Simon Mikuda @ 2023-08-06 8:01 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Simon Mikuda
When we connect A2DP profile and remote device doesn't have our key
(e.g. was deleted) we've received "unknown" error.
These patches add mapping to "Invalid exchange" error which is returned
in this use case as "key missing" error.
Simon Mikuda (2):
error: Add "Invalid exchange" mapping
a2dp: Expose "Key missing" error
profiles/audio/a2dp.c | 1 +
src/error.c | 4 ++++
src/error.h | 2 ++
3 files changed, 7 insertions(+)
--
2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH BlueZ 1/2] error: Add "Invalid exchange" mapping
2023-08-06 8:01 [PATCH BlueZ 0/2] Report proper error on connect Simon Mikuda
@ 2023-08-06 8:01 ` Simon Mikuda
2023-08-06 9:51 ` Report proper error on connect bluez.test.bot
2023-08-06 8:01 ` [PATCH BlueZ 2/2] a2dp: Expose "Key missing" error Simon Mikuda
2023-08-07 23:20 ` [PATCH BlueZ 0/2] Report proper error on connect patchwork-bot+bluetooth
2 siblings, 1 reply; 5+ messages in thread
From: Simon Mikuda @ 2023-08-06 8:01 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Simon Mikuda
This error is returned on this event:
> HCI Event: Auth Complete (0x06) plen 3
Status: PIN or Key Missing (0x06)
Handle: 11 Address: 00:00:00:00:00:00 (OUI 00-00-00)
---
src/error.c | 4 ++++
src/error.h | 2 ++
2 files changed, 6 insertions(+)
diff --git a/src/error.c b/src/error.c
index 29c071067..f179e6cda 100644
--- a/src/error.c
+++ b/src/error.c
@@ -171,6 +171,8 @@ const char *btd_error_bredr_conn_from_errno(int errno_code)
return ERR_BREDR_CONN_ABORT_BY_LOCAL;
case EPROTO:
return ERR_BREDR_CONN_LMP_PROTO_ERROR;
+ case EBADE:
+ return ERR_BREDR_CONN_KEY_MISSING;
default:
return ERR_BREDR_CONN_UNKNOWN;
}
@@ -209,6 +211,8 @@ const char *btd_error_le_conn_from_errno(int errno_code)
return ERR_LE_CONN_ABORT_BY_LOCAL;
case EPROTO:
return ERR_LE_CONN_LL_PROTO_ERROR;
+ case EBADE:
+ return ERR_LE_CONN_KEY_MISSING;
default:
return ERR_LE_CONN_UNKNOWN;
}
diff --git a/src/error.h b/src/error.h
index cc7790a23..83206cb48 100644
--- a/src/error.h
+++ b/src/error.h
@@ -43,6 +43,7 @@
#define ERR_BREDR_CONN_LMP_PROTO_ERROR "br-connection-lmp-protocol-"\
"error"
#define ERR_BREDR_CONN_CANCELED "br-connection-canceled"
+#define ERR_BREDR_CONN_KEY_MISSING "br-connection-key-missing"
#define ERR_BREDR_CONN_UNKNOWN "br-connection-unknown"
/* LE connection failure reasons */
@@ -63,6 +64,7 @@
#define ERR_LE_CONN_LL_PROTO_ERROR "le-connection-link-layer-protocol-"\
"error"
#define ERR_LE_CONN_GATT_BROWSE "le-connection-gatt-browsing"
+#define ERR_LE_CONN_KEY_MISSING "le-connection-key-missing"
#define ERR_LE_CONN_UNKNOWN "le-connection-unknown"
DBusMessage *btd_error_invalid_args(DBusMessage *msg);
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH BlueZ 2/2] a2dp: Expose "Key missing" error
2023-08-06 8:01 [PATCH BlueZ 0/2] Report proper error on connect Simon Mikuda
2023-08-06 8:01 ` [PATCH BlueZ 1/2] error: Add "Invalid exchange" mapping Simon Mikuda
@ 2023-08-06 8:01 ` Simon Mikuda
2023-08-07 23:20 ` [PATCH BlueZ 0/2] Report proper error on connect patchwork-bot+bluetooth
2 siblings, 0 replies; 5+ messages in thread
From: Simon Mikuda @ 2023-08-06 8:01 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Simon Mikuda
This error is not expected and retries will likely end up with same error.
---
profiles/audio/a2dp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
index 47b5dd7c3..b43161a13 100644
--- a/profiles/audio/a2dp.c
+++ b/profiles/audio/a2dp.c
@@ -307,6 +307,7 @@ static int error_to_errno(struct avdtp_error *err)
switch (perr) {
case EHOSTDOWN:
case ECONNABORTED:
+ case EBADE:
return -perr;
default:
/*
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* RE: Report proper error on connect
2023-08-06 8:01 ` [PATCH BlueZ 1/2] error: Add "Invalid exchange" mapping Simon Mikuda
@ 2023-08-06 9:51 ` bluez.test.bot
0 siblings, 0 replies; 5+ messages in thread
From: bluez.test.bot @ 2023-08-06 9:51 UTC (permalink / raw)
To: linux-bluetooth, simon.mikuda
[-- Attachment #1: Type: text/plain, Size: 1206 bytes --]
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=773409
---Test result---
Test Summary:
CheckPatch PASS 0.92 seconds
GitLint PASS 0.63 seconds
BuildEll PASS 32.96 seconds
BluezMake PASS 1188.84 seconds
MakeCheck PASS 13.56 seconds
MakeDistcheck PASS 193.65 seconds
CheckValgrind PASS 317.85 seconds
CheckSmatch PASS 443.22 seconds
bluezmakeextell PASS 132.21 seconds
IncrementalBuild PASS 2073.05 seconds
ScanBuild WARNING 1396.94 seconds
Details
##############################
Test: ScanBuild - WARNING
Desc: Run Scan Build
Output:
profiles/audio/a2dp.c:352:8: warning: Use of memory after it is freed
if (!cb->resume_cb)
^~~~~~~~~~~~~
1 warning generated.
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH BlueZ 0/2] Report proper error on connect
2023-08-06 8:01 [PATCH BlueZ 0/2] Report proper error on connect Simon Mikuda
2023-08-06 8:01 ` [PATCH BlueZ 1/2] error: Add "Invalid exchange" mapping Simon Mikuda
2023-08-06 8:01 ` [PATCH BlueZ 2/2] a2dp: Expose "Key missing" error Simon Mikuda
@ 2023-08-07 23:20 ` patchwork-bot+bluetooth
2 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+bluetooth @ 2023-08-07 23:20 UTC (permalink / raw)
To: Simon Mikuda; +Cc: linux-bluetooth
Hello:
This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Sun, 6 Aug 2023 10:01:07 +0200 you wrote:
> When we connect A2DP profile and remote device doesn't have our key
> (e.g. was deleted) we've received "unknown" error.
>
> These patches add mapping to "Invalid exchange" error which is returned
> in this use case as "key missing" error.
>
> Simon Mikuda (2):
> error: Add "Invalid exchange" mapping
> a2dp: Expose "Key missing" error
>
> [...]
Here is the summary with links:
- [BlueZ,1/2] error: Add "Invalid exchange" mapping
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=0ee60b31a843
- [BlueZ,2/2] a2dp: Expose "Key missing" error
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=59569c1f947d
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-08-07 23:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-06 8:01 [PATCH BlueZ 0/2] Report proper error on connect Simon Mikuda
2023-08-06 8:01 ` [PATCH BlueZ 1/2] error: Add "Invalid exchange" mapping Simon Mikuda
2023-08-06 9:51 ` Report proper error on connect bluez.test.bot
2023-08-06 8:01 ` [PATCH BlueZ 2/2] a2dp: Expose "Key missing" error Simon Mikuda
2023-08-07 23:20 ` [PATCH BlueZ 0/2] Report proper error on connect patchwork-bot+bluetooth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox