Bluetooth: Fix handling of getpeername() for HCI sockets
Subsystems (2)
Marcel Holtmann
maintainerPATCH 1/1 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 Marcel Holtmann <[email protected]>
--- net/bluetooth/hci_sock.c | 3 +++ 1 file changed, 3 insertions(+)
net/bluetooth/hci_sock.c +3 -0
@@ -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 ;
Signature · 1 line
1.8.3.1
Hi Marcel,
2013-08-26 Marcel Holtmann <[email protected]>:
Quoted 8 lines
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 <[email protected]>--- net/bluetooth/hci_sock.c | 3 +++ 1 file changed, 3 insertions(+)
Patch has been applied to bluetooth-next. Thanks.
Gustavo