projects
/
GitHub
/
exynos8895
/
android_kernel_samsung_universal8895.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2da3193
)
Bluetooth: Return ENETDOWN when interface is down
author
Marcel Holtmann
<marcel@holtmann.org>
Wed, 18 Nov 2009 00:05:00 +0000
(
01:05
+0100)
committer
Marcel Holtmann
<marcel@holtmann.org>
Thu, 3 Dec 2009 18:34:20 +0000
(19:34 +0100)
Sending commands to a down interface results in a timeout while clearly
it should just return ENETDOWN. When using the ioctls this works fine,
but not when using the HCI sockets sendmsg interface.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/hci_sock.c
patch
|
blob
|
blame
|
history
diff --git
a/net/bluetooth/hci_sock.c
b/net/bluetooth/hci_sock.c
index 1ca5c7ca9bd44833f268c35b51670e7c05d6b327..c3701f37aeb01725d4c96a90f4445d657964ee3e 100644
(file)
--- a/
net/bluetooth/hci_sock.c
+++ b/
net/bluetooth/hci_sock.c
@@
-414,6
+414,11
@@
static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
goto done;
}
+ if (!test_bit(HCI_UP, &hdev->flags)) {
+ err = -ENETDOWN;
+ goto done;
+ }
+
if (!(skb = bt_skb_send_alloc(sk, len, msg->msg_flags & MSG_DONTWAIT, &err)))
goto done;