projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
23bb576
)
Bluetooth: Improve handling of HCI control channel in bind
author
Gustavo F. Padovan
<padovan@profusion.mobi>
Thu, 23 Dec 2010 01:00:34 +0000
(23:00 -0200)
committer
Gustavo F. Padovan
<padovan@profusion.mobi>
Thu, 23 Dec 2010 01:00:34 +0000
(23:00 -0200)
Does not allow any channel different of HCI_CHANNEL_RAW and
HCI_CHANNEL_CONTROL to bind.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
net/bluetooth/hci_sock.c
patch
|
blob
|
history
diff --git
a/net/bluetooth/hci_sock.c
b/net/bluetooth/hci_sock.c
index f6c18abab797872daf9ba688216e254236116e63..29827c77f6ce20ab2eb83dce428e47533303d465 100644
(file)
--- a/
net/bluetooth/hci_sock.c
+++ b/
net/bluetooth/hci_sock.c
@@
-380,7
+380,10
@@
static int hci_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_le
if (haddr.hci_family != AF_BLUETOOTH)
return -EINVAL;
- if (haddr.hci_channel != HCI_CHANNEL_RAW && !enable_mgmt)
+ if (haddr.hci_channel > HCI_CHANNEL_CONTROL)
+ return -EINVAL;
+
+ if (haddr.hci_channel == HCI_CHANNEL_CONTROL && !enable_mgmt)
return -EINVAL;
lock_sock(sk);