All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: Fix handling of getpeername() for HCI sockets
@ 2013-08-26  7:06 Marcel Holtmann
  2013-09-01 15:31 ` Gustavo Padovan
  0 siblings, 1 reply; 2+ messages in thread
From: Marcel Holtmann @ 2013-08-26  7:06 UTC (permalink / raw)
  To: linux-bluetooth

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>
---
 net/bluetooth/hci_sock.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index c45ec25..d858941 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -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;
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Bluetooth: Fix handling of getpeername() for HCI sockets
  2013-08-26  7:06 [PATCH] Bluetooth: Fix handling of getpeername() for HCI sockets Marcel Holtmann
@ 2013-09-01 15:31 ` Gustavo Padovan
  0 siblings, 0 replies; 2+ messages in thread
From: Gustavo Padovan @ 2013-09-01 15:31 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: linux-bluetooth

Hi Marcel,

2013-08-26 Marcel Holtmann <marcel@holtmann.org>:

> 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>
> ---
>  net/bluetooth/hci_sock.c | 3 +++
>  1 file changed, 3 insertions(+)

Patch has been applied to bluetooth-next. Thanks.

	Gustavo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-09-01 15:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-26  7:06 [PATCH] Bluetooth: Fix handling of getpeername() for HCI sockets Marcel Holtmann
2013-09-01 15:31 ` Gustavo Padovan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.