Skip to content

Commit

Permalink
Bluetooth: Improve handling of HCI control channel in bind
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Gustavo F. Padovan committed Dec 23, 2010
1 parent 23bb576 commit 17f9cc3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion net/bluetooth/hci_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 17f9cc3

Please sign in to comment.