Commit 06f43cbc authored by Marcel Holtmann's avatar Marcel Holtmann Committed by Gustavo Padovan

Bluetooth: Fix handling of getpeername() for HCI sockets

The HCI sockets do not have a peer associated with it and so make sure
that getpeername() returns EOPNOTSUPP since this operation is actually
not supported on HCI sockets.
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
parent f81fe64f
......@@ -699,6 +699,9 @@ static int hci_sock_getname(struct socket *sock, struct sockaddr *addr,
BT_DBG("sock %p sk %p", sock, sk);
if (peer)
return -EOPNOTSUPP;
if (!hdev)
return -EBADFD;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment