Parent: d20ee8273e61e16c78582344f274254973cdf00f
Author: Pali Rohár <pali@kernel.org>
Committer: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: 2020-04-22 21:20:23
Tree: 5fa842d0c8bf1434a5aeb8a7ca1e58803d729a5f
profile: Fix reporting error message when connection failed Some bluetooth headsets do not support connecting more then one bluetooth profile (e.g. in parallel A2DP and HSP, or HSP and HFP) and issuing connect() syscall for second profile returns just ECONNREFUSED. Prior this patch bluetooth daemon for such situation reported following message to log: Unable to get connect data for Headset Voice gateway: getpeername: Transport endpoint is not connected (107) Message is incorrect as connect() syscall failed, not getpeername(). This patch fixes this problem and logs correct error message: Headset Voice gateway failed connect to XX:XX:XX:XX:XX:XX: Connection refused (111) Main problem was in ext_connect() function which called bt_io_get() for retrieving remote address (BT_IO_OPT_DEST) and if it failed then original error from connect() syscall was masked. Because it is not possible to retrieve BT_IO_OPT_DEST for unconnected socket, original destination address for error message is propagated via connect_add() function in btio.
Diffstat
| M | src/profile.c | | | 5 | +++- - |
1 files changed, 3 insertions(+), 2 deletions(-)