diff mbox series

[BlueZ,v1] client/player: Fix transport.send

Message ID 20240613134854.1545034-1-luiz.dentz@gmail.com (mailing list archive)
State Accepted
Commit 7861c511ca7ecbbf8223aee22a3085d6152799cf
Headers show
Series [BlueZ,v1] client/player: Fix transport.send | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/BuildEll success Build ELL PASS
tedd_an/BluezMake success Bluez Make PASS
tedd_an/MakeCheck success Bluez Make Check PASS
tedd_an/MakeDistcheck success Make Distcheck PASS

Commit Message

Luiz Augusto von Dentz June 13, 2024, 1:48 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This fixes the usage of getpeername, introduced by 04153538aaf4
("client/player: Fix using unicast QoS for broadcast"), without
initializing optlen which causes the following problem:

Unable to send: Operation not permitted (1)
---
 client/player.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

patchwork-bot+bluetooth@kernel.org June 13, 2024, 5:40 p.m. UTC | #1
Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Thu, 13 Jun 2024 09:48:54 -0400 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> This fixes the usage of getpeername, introduced by 04153538aaf4
> ("client/player: Fix using unicast QoS for broadcast"), without
> initializing optlen which causes the following problem:
> 
> Unable to send: Operation not permitted (1)
> 
> [...]

Here is the summary with links:
  - [BlueZ,v1] client/player: Fix transport.send
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=7861c511ca7e

You are awesome, thank you!
diff mbox series

Patch

diff --git a/client/player.c b/client/player.c
index df5cb892428a..7a7598c397af 100644
--- a/client/player.c
+++ b/client/player.c
@@ -5140,7 +5140,7 @@  static void cmd_send_transport(int argc, char *argv[])
 			err = transport_send(transport, fd, NULL);
 		} else {
 			struct sockaddr_iso addr;
-			socklen_t optlen;
+			socklen_t optlen = sizeof(addr);
 
 			err = getpeername(transport->sk, &addr, &optlen);
 			if (!err) {
@@ -5154,7 +5154,7 @@  static void cmd_send_transport(int argc, char *argv[])
 		}
 
 		if (err < 0) {
-			bt_shell_printf("Unable to send: %s (%d)",
+			bt_shell_printf("Unable to send: %s (%d)\n",
 						strerror(-err), -err);
 			close(fd);
 			return bt_shell_noninteractive_quit(EXIT_FAILURE);