mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-15 00:04:29 +08:00
client/player: Fix transport.send
This fixes the usage of getpeername, introduced by 04153538aa
("client/player: Fix using unicast QoS for broadcast"), without
initializing optlen which causes the following problem:
Unable to send: Operation not permitted (1)
This commit is contained in:
parent
8915529993
commit
7861c511ca
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user