Skip to content

Commit

Permalink
Bluetooth: Fix handling of getpeername() for HCI sockets
Browse files Browse the repository at this point in the history
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: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
  • Loading branch information
Marcel Holtmann authored and Gustavo Padovan committed Sep 16, 2013
1 parent f81fe64 commit 06f43cb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/bluetooth/hci_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 06f43cb

Please sign in to comment.