Bluetooth: Improve handling of HCI control channel in bind

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>
This commit is contained in:
Gustavo F. Padovan 2010-12-22 23:00:34 -02:00
Родитель 23bb57633d
Коммит 17f9cc3124
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -380,7 +380,10 @@ static int hci_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_le
if (haddr.hci_family != AF_BLUETOOTH) if (haddr.hci_family != AF_BLUETOOTH)
return -EINVAL; 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; return -EINVAL;
lock_sock(sk); lock_sock(sk);