/* Apply filter */
flt = &hci_pi(sk)->filter;
- if (!test_bit((skb->pkt_type & HCI_FLT_TYPE_BITS), &flt->type_mask))
+ if (!test_bit((skb->pkt_type == HCI_VENDOR_PKT) ?
+ 0 : (skb->pkt_type & HCI_FLT_TYPE_BITS), &flt->type_mask))
continue;
if (skb->pkt_type == HCI_EVENT_PKT) {
if (!capable(CAP_NET_ADMIN))
return -EACCES;
+ if (test_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks))
+ return -EPERM;
+
if (arg)
set_bit(HCI_RAW, &hdev->flags);
else
return 0;
+ case HCISETSECMGR:
+ if (!capable(CAP_NET_ADMIN))
+ return -EACCES;
+
+ if (arg)
+ set_bit(HCI_SECMGR, &hdev->flags);
+ else
+ clear_bit(HCI_SECMGR, &hdev->flags);
+
+ return 0;
+
case HCIGETCONNINFO:
return hci_get_conn_info(hdev, (void __user *)arg);
goto done;
}
-int hci_sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, int len)
+static int hci_sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, int len)
{
struct hci_ufilter uf = { .opcode = 0 };
struct sock *sk = sock->sk;
return err;
}
-int hci_sock_getsockopt(struct socket *sock, int level, int optname, char __user *optval, int __user *optlen)
+static int hci_sock_getsockopt(struct socket *sock, int level, int optname, char __user *optval, int __user *optlen)
{
struct hci_ufilter uf;
struct sock *sk = sock->sk;
return 0;
}
-struct proto_ops hci_sock_ops = {
+static struct proto_ops hci_sock_ops = {
.family = PF_BLUETOOTH,
.owner = THIS_MODULE,
.release = hci_sock_release,
return NOTIFY_DONE;
}
-struct net_proto_family hci_sock_family_ops = {
+static struct net_proto_family hci_sock_family_ops = {
.family = PF_BLUETOOTH,
.owner = THIS_MODULE,
.create = hci_sock_create,
};
-struct notifier_block hci_sock_nblock = {
+static struct notifier_block hci_sock_nblock = {
.notifier_call = hci_sock_dev_event
};